Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8031925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:14:57+00:00 2026-06-05T01:14:57+00:00

I want to upload a photo using the PhoneGap API. The FileTransfer object is

  • 0

I want to upload a photo using the PhoneGap API. The FileTransfer object is basically what I want because I want to upload a photo but then I want to include some basic information about the user as well such as their user ID so that I can store it as their’s. My code is as follows and this is basically coming from the PhoneGap API but with my additions

<html><head><script>function uploadPhotoandID(imageURI, userID) {
        var options = new FileUploadOptions();
        options.fileKey="file";
        options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
        options.mimeType="image/jpeg";

        var params = new Object();
        params.value1 = "test";
        params.value2 = "param";

        options.params = params;

        var ft = new FileTransfer();
        ft.upload(imageURI, "http://some.server.com/upload.php", win, fail, options);
        ft.upload(userID, "http://some.server.com/upload.php", win, fail, options);
    }</script></head>
    <body><button onclick="uploadPhotoandID(imageURI, userID)">Click me</button></body</html>

Do I need those parameters in the function in HTML like that? and is it able to retrieve those variables even though they are in the script in the header?

If you see any other errors please let me know!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:14:58+00:00Added an answer on June 5, 2026 at 1:14 am

    Right so all you want to do is instead of:

    var params = new Object();
    params.value1 = "test";
    params.value2 = "param";
    
    options.params = params;
    

    you would:

    var params = new Object();
    params. userID = userID;
    
    options.params = params;
    

    Now you don’t have to make two calls to “upload”. The userID parameter will be available as:

    $_POST["userID"]
    

    in your PHP script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using PHP 5 and I want to add a link Upload photo
I'm using paperclip to upload some attachments to my application. This works fine, but
I'm currently using PhoneGap and I proceed to a FileTransfer Upload via my application.
I'm trying to upload images using Graph API Batch Request, but i'm unable to
i want to upload image to facebook album using facebook api, i search alot
I have a web app and I want to take photos and then upload
i want to upload the sound file (.ogg) in server. But it should write
I want to upload and store video files to my server using PHP. Could
I want to upload files directly to IIS7 (in this case I am using
I want to upload some files of size 35MB on to the blob container.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.