cubiclesoft / jquery-fancyfileuploader

A jQuery plugin to convert the HTML file input type into a fancy file uploader under a MIT or LGPL license. Mobile-friendly too!
58 stars 27 forks source link

Use as form file input (no server side) #29

Closed brodrigz closed 1 year ago

brodrigz commented 1 year ago

Can this be used as normal file input inside a form, without server side uploading, doing the upload on the form submit only?

cubiclesoft commented 1 year ago

No. This widget is designed to work around the severe limitations of HTTP upload form submissions. Uploads via the widget happen out-of-band of regular form submission and can even be fragmented (via chunks) across multiple requests. Regular form submissions are subject to web server (e.g. POST size limits), server side scripting language (e.g. POST size and upload limits), and even client configuration limitations (e.g. TCP/IP timeouts).

Upload a file to a temporary file, pass the temporary filename in your form, and on the server side rename the file to its final location when the form is submitted. Periodically clean out old temporary files to deal with files that were uploaded but the form submission was abandoned.

This widget does progressive enhancement. It takes a standard file input and upgrades it. For browsers that have Javascript disabled, they fall back to displaying the standard browser file input. The server side code should gracefully handle both cases.

brodrigz commented 1 year ago

Got it, thanks for clarifying.