Can I upload a file using AJAX without an iframe or Flash?

Every time I looked at loading AJAXy files, an iframe was always used somewhere.

Can I upload a file using AJAX without an iframe or Flash? What about later versions of Firefox and Chrome?

I discuss with my colleagues claiming that you cannot load AJAXy using pure Javascript, since you cannot read the contents of the file from the user's hard drive in order to transfer the contents of the file through an AJAX call to the server side of the script.

+4
source share
3 answers

You can use the file APIs in firefox (3.6 and above), and I think the latest webkit also supports it (not sure).

I made a Mootools plugin that works on FF:

http://mootools.standupweb.net/dragndrop.php

+2
source

You can use the famous jQuery Uploadify plugin .

Uploadify is a jQuery plugin that integrates a fully customizable multiple file upload website. It uses a mixture of Javascript, ActionScript and any server language to dynamically create an instance over any DOM element on the page.

+2
source
+2
source

Source: https://habr.com/ru/post/1337029/


All Articles