Alternative for File API for Outdated Browser

1

I need to read the binary of a file and post to a given URL, but without storing the file itself to the server (I can not store the file).

To complicate - I would love to use the HTML5 file API for this, but I have to support IE9 (in every sense of the word "bear"), which does not implement HTML5.

Is there any way? Is it possible, for example, to use some upload mechanism to intercept the file at the time it is uploading, then read its contents and cancel the upload via Javascript?

    
asked by anonymous 09.09.2014 / 22:50

1 answer

1

Can not you store the file temporarily? If so, you could do the following:

1) You create an ajax that uploads the file to a / tmp folder (purposely for the file to be deleted later);

2) This ajax calls a method on your server (it can be shell script or even php);

3) This method will read and return the binary you want and delete the file;

4) This binary will be stored in your javascript (success) object, then just take the value of that object and put it in your url.

If you need help implementing this step by step let me know that I edit the answer and put an example code.

    
18.09.2014 / 16:33