Alternative to File API for outdated browser

Asked

Viewed 53 times

1

I need to read the binary of a file and post to a certain URL, but without storing the file itself to the server (I cannot 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 "support"), which does not implement HTML5.

Is there a way? It would be possible, for example, to use some upload mechanism to intercept the file at the moment it is going up, to then read its content and cancel the upload via Javascript?

1 answer

1


Can’t you store the file even temporarily? If yes, 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 php itself);

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

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

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.