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 7809205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:21:25+00:00 2026-06-02T03:21:25+00:00

I am writing a phonegap application which needs to download a file (pdf,doc,txt). I

  • 0

I am writing a phonegap application which needs to download a file (pdf,doc,txt).
I am using phonegap 1.5.0 i.e. cordova 1.5.0.js file.

I looked into the phonegap api at
http://docs.phonegap.com/en/1.5.0/phonegap_file_file.md.html#FileTransfer
and trying to use FileTransfer’s download method. following is the code which I am using:

save: function (fileName, fileType, url) {
    documentsaver.fileName = fileName;
    documentsaver.fileType = fileType;
    documentsaver.url = url;
    window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, fsSuccess, fail);

    function fail(event) {
        jqmSimpleMessage('Error Code ' + event.target.error.code);
    }

    function fsSuccess(fileSystem) {
        documentsaver.directoryEntry = fileSystem.root;

        //Creating directory in which document should be saved if it does not exist
        documentsaver.directoryEntry.getDirectory(documentsaver.directoryName, { create: true, exclusive: false }, dirSuccess, fail);

        function dirSuccess(parent) {
            console.log('Directory Created at '+parent.fullPath+' with name '+parent.name);
            //Moving directoryEntry reference to newly created directory
            documentsaver.directoryEntry = parent;

            //Creating file which will be written
            var completeFileName = documentsaver.fileName + '.' + documentsaver.fileType;
            console.log('completeFileName === >' + completeFileName );
            var filePath = documentsaver.directoryEntry.fullPath + '/' + completeFileName;
            console.log('filePath === >' + filePath );

            var fileTransfer = new FileTransfer();
            fileTransfer.download(
                    url,
                    filePath,
                    function(entry) {
                        console.log("download complete: " + entry.fullPath);
                    },
                    function(error) {
                        console.log("download error source " + error.source);
                        console.log("download error target " + error.target);
                        console.log("upload error code" + error.code);
                    }
                );
        }

fileName: name of the file which I am saving.
fileType: fileType i.e. pdf or doc or png.
url: url to the actual resource.

Following is the console log when i run it on windows emulator:

Log:”This is a dir”
The thread ” (0xf0a01c6) has exited with code 0 (0x0).
Log:”filePath === >/JarusDocuments/Personal Auto Application.pdf”
The thread ” (0xff001f6) has exited with code 0 (0x0).
Log:”Directory Created at /JarusDocuments with name JarusDocuments”
Log:”Error in success callback: File11 = Object doesn’t support property or method ‘download'”
The thread ” (0xe3201b6) has exited with code 0 (0x0).
The thread ” (0xf18014e) has exited with code 0 (0x0).
Log:”completeFileName === >Personal Auto Application.pdf”
The thread ” (0xf1c01de) has exited with code 0 (0x0).

It is saying that FileTransfer does not support download method. Although log already says that it is able to create all the directories that I want.

  • 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-02T03:21:26+00:00Added an answer on June 2, 2026 at 3:21 am

    In Phonegap 1.5 for WP7 the FileTransfer object is not download capable (only upload). The 1.6 version however claims to be capable of doing just that (you can read it for yourself in phonegap’s blog post about the release here)

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

Sidebar

Related Questions

I am writing an application using PhoneGap, and am finding it hard to work
I'm writing an HTML5 mobile application, and using PhoneGap to push it to the
I am writing a iphone application using phonegap and ios. I have a weird
I'm diving into writing a mobile app with jQuery Mobile/PhoneGap. I'm using this sample
I'm writing a phonegap app for iPhone/Android, heavily using the google maps javascript api.
I am writing application using PhoneGap on Android. I need to call some PhoneGap
I'm currently writing an iOS app using the PhoneGap 2.0 API. I am using
I'm currently writing an application using Zepto and phonegap, and I need to know
I am writing an application for iPad using phonegap (Simple application using HTML5 and
I'm writing a PhoneGap(Cordova) app with jQuery and jQuery Mobile. I'm a noob, so

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.