Getting the uploading file name before upload with jQuery File Upload plugin -


I am using the jQuery File Upload plugin to upload multiple files to the server. I'm using it with a custom web service that will store images uploaded to the server. However, in addition to the POST request body, I will also have to file the name of the web service which is being uploaded, so with each file transfer, I have to pass a web service in the name of the file. Can anyone tell me how can I get a file name and send it with each upload request? I basically need to get it from the field of no extra input fields. If a user has selected 10 files, then I have to take a name for each file in the queue and submit it with the upload request.

Thank you.

OK, this is the solution that works:

  // file name in the queue fil file = ""; // File on the file to pass the web service $ ('# fileupload') to assign the name of that file. ('Fileuploadadd', function (e, data) {$ .each (data.files, function (index, file) {fileName = file.name;}}}}); // Submit file upload - Assign file name value to form data $ ('# fileupload'). Bind ('fileuploadsubmit', function (e, data) {data.formData = {"file": fileName};});    

Comments

Popular posts from this blog

c# - passing input text from view to contoller with FacebookContext using Facebook app -

ios - Does Core Data autoupdate a many to many relationship on saving -

Calling a C++ function from C# by passing a string with variable size to it -