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

  • SEARCH
  • Home
  • 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 8085637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:11:22+00:00 2026-06-05T18:11:22+00:00

i am developing a phonegap project in mac os with xcode. in xcode if

  • 0

i am developing a phonegap project in mac os with xcode. in xcode if i create a cordova based application it automatically creates cordova-1.6.0.js. i am using fileupload plugin for sending svg file to my server. in fileupload.js i have written alert fileuplaoder function as following,

 var FileUploader = function() { 
    alert("gi");
}

this alert is working, but when i give the aler under upload function,

FileUploader.prototype.upload = function(server, file, params, fileKey, fileName, mimeType, success, fail, progress) {
    alert("upload");
    this._doUpload('upload', server, file, params, fileKey, fileName, mimeType, success, fail, progress);
};

this alert is not working. my call for this plugin in html page is,

window.plugins.fileUploader.upload('http:192.168.1.54:8080/downloadFiles', '/Users/User/Library/Application Support/iPhone Simulator/5.0/Applications/408DBBC7-67F7-4E8B-B41C-663CDC0377B5/Documents/image5_1.jpg.txt.svg', {foo: 'bar'}, 'myPhoto', 'image5_1.jpg.txt.svg', 'image/svg', 
                                                function(result) {
                                                console.log('Done: ' + result);
                                                }, 
                                                function(result) {
                                                console.log("Error: " + result);
                                                }, 
                                                function(loaded, total) {
                                                var percent = 100 / total * loaded;
                                                console.log('Uploaded  ' + percent);

                                                }
                                                );

in fileupload.js there is cordova.addConstructor method. but in my generated cordova.1.6.0.js file there is no such method. i dont know whats happening. pl help me to work this plugin.

  • 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-05T18:11:24+00:00Added an answer on June 5, 2026 at 6:11 pm

    i found the solution. there is a upload and download options in the cordova file api itself. its working fine. the code is,

    document.addEventListener("deviceready", onDeviceReady, false);
    
                // Cordova is ready
                //
                function onDeviceReady() {
                    window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
                }
    
                function gotFS(fileSystem) {
                    fileSystem.root.getFile("image5_2.jpg.svg", {create: true, exclusive: false}, gotFileEntry, fail);
                }
    
                function gotFileEntry(fileEntry) {
                    var localpath=fileEntry.fullPath;
                    uploadPhoto(localpath);
                    //fileEntry.createWriter(gotFileWriter, fail);
                }
    
                function uploadPhoto(imageURI) {
                    alert(imageURI);
                    var options = new FileUploadOptions();
                    options.fileKey="file";
                    options.fileName="image5_2.jpg.svg";
                    options.mimeType="image/svg+xml";
    
                    var params = new Object();
                    params.value1 = "test";
                    params.value2 = "param";
    
                    options.params = params;
    
                    var ft = new FileTransfer();
                    ft.upload(imageURI, "http://192.168.1.54:8080/POC/fileUploader", win, fail, options);
                }
    
                function win(r) {
                    console.log("Code = " + r.responseCode);
                    console.log("Response = " + r.response);
                    console.log("Sent = " + r.bytesSent);
                }
    
                function fail(error) {
                    alert("An error has occurred: Code = " + error.code);
                    console.log("upload error source " + error.source);
                    console.log("upload error target " + error.target);
                }
    

    pl use this.

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

Sidebar

Related Questions

I just finished developing my iOs application using Phonegap on xCode 4.1 and i'm
I am developing a BlackBerry Phonegap application. Therefore, I am using JavaScript. From a
I am developing an application using jQuery mobile 1.1.0 RC1 and phonegap 1.5.0 I
I'm starting my first PhoneGap project and am developing using Visual Studio and Windows
I am developing application using phonegap in eclipse for android .I have created folder
What is the performance trade off of using PhoneGap for developing an application that
I'm developing a phonegap based application, and I also need to call javascript from
I am developing an Android application using Phonegap . I need to make the
Im developing a mobile application using phonegap and jquery mobile. I created the layout
I'm developing an app using phonegap/cordova (1.7.0), I can't figure out how to make

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.