Saturday, May 25, 2024
 Popular · Latest · Hot · Upcoming
71
rated 0 times [  74] [ 3]  / answers: 1 / hits: 23035  / 13 Years ago, fri, january 20, 2012, 12:00:00

I'm using the jQuery file upload plugin which has an API to programmatically upload files. The documentation writes:



$('#fileupload').fileupload('add', {files: filesList});


The problem is that I don't know what filesList should be. I have tried the following unsuccessfully:



$('#fileupload').fileupload('add', {files: ['/Users/bob/Desktop/test.png']});


What should filesList be exactly?


More From » jquery

 Answers
64

To quote the documentation:




The second argument must be an object with an array (or array-like list) of File or Blob objects as files property.




You can get file objects using the files property of a file type input or the HTML5 File API.



For more detail regarding working with the FileAPI and file inputs see:
MDC - Using files from web applications


[#87901] Thursday, January 19, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tyriquehenryq

Total Points: 248
Total Questions: 81
Total Answers: 105

Location: Bermuda
Member since Thu, Apr 20, 2023
1 Year ago
;