Question

The jQuery-File-Upload claims to work with IE6+ and there are no open issues about it at https://github.com/blueimp/jQuery-File-Upload

So I am wondering how it accomplishes this when other polyfils to the file API have needed add-ons to access the file system.

Was it helpful?

Solution

As far as I can tell without looking deeply into the code, it will use a iframe.

Look here:

https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.iframe-transport.js#L70

The thing is that if you can't do it without ajax/websockets or whatever... then the only possible way to achieve this is to do the request into an iframe.

Inside the iframe, there will be a form with a file input. It will do a request to the server as usual and when the iframe reloads, the javascript code should be able to update the user with the file being uploaded. The iframe could contain something like an id to the file attachement to add to the main form... then on the server it should be possible to link the file attachement to the form.

That's pretty much like that. This method has some disadvantages though because it works within an iframe. Iframes are getting much more restricted for security reasons than they were before.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top