简体   繁体   中英

Upload Like Normal using the jQuery-File-Upload plugin

I am wanting to use the jQuery-File-Upload plugin located here https://github.com/blueimp/jQuery-File-Upload . I have implemented it for the most part but I am having trouble actually submitting the form. What I would like to do is when the user clicks on "Upload", instead of uploading it to a default directory on my server, I would like the page to POST so I can verify the files and then store them on my server. Is this possible to do with this plugin?

According to https://github.com/blueimp/jQuery-File-Upload/wiki/API it looks like you should be able to set an upload handler end point using a url parameter during initialization. I would image you could point that to a php/aspx/anything else location and handle it in there.

The File Upload widget is initialized by calling the fileupload method on a jQuery collection with the target HTML element:

 $('#fileupload').fileupload(); 

The target element is usually a container element holding the file upload form, or the file upload form itself, but it can also be just the file input element itself, if an url is provided as options parameter.

The initialization method's first argument is an object that allows you to initialize the widget with various Options:

 $('#fileupload').fileupload({ url: '/path/to/upload/handler.json', sequentialUploads: true }); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM