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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:34:42+00:00 2026-06-05T22:34:42+00:00

I am using Phonegap file upload to upload SVG files to my server. It’s

  • 0

I am using Phonegap file upload to upload SVG files to my server. It’s working fine. But I need to take all SVG files from the iPad’s absolute path and send them to my server. I don’t know how to get all .svg files using Phonegap’s file API, so that I can send to the server looping through file names. Please tell me how to do this.

My code for file upload is:

document.addEventListener("deviceready", onDeviceReady, false);
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);
}
function uploadPhoto(imageURI) {
  var options = new FileUploadOptions();
  var ft = new FileTransfer();
  ft.upload(imageURI, "http://192.168.1.54:8080/POC/fileUploader", win, fail, options);
}
  • 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-05T22:34:44+00:00Added an answer on June 5, 2026 at 10:34 pm

    You need to create a DirectoryReader from the root FileSystem and loop through all the entries looking for .svg files.

    function gotFS(fileSystem) {
        var reader = fileSystem.root.createReader();
        reader.readEntries(gotList, fail);    
    }
    
    function gotList(entries) {
        var i;
        for (i=0; i<entries.length; i++) {
            if (entries[i].name.indexOf(".svg") != -1) {
                uploadPhoto(entries[i].fullPath);
            }
        }
    }
    

    You may have to make some minor edits to this code but it should get you started.

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

Sidebar

Related Questions

I'm trying to send image files using phonegap's filetransfer.upload , but the returned file
I wanted to access my existing .db file from sdcard using phoneGap but method
I am working on PhoneGap Build API to upload file and create its apk.
I am using phonegap for IOS. I created a Plugin to unzip files. But
I am developing application for iOS using phonegap.I want to upload my local files
I am using phonegap file api to create a directory and create a file
I am trying to write a file in android using phonegap cordova 1.5.0. Below
I am working on a project with dreamweaver CS 6, using the phonegap build
I'm creating an AndroidApp using Phonegap, but when i run the emulator i got
I am using phonegap file reading functionality, once i read the content and i

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.