0

Is it possible to perform a file upload using HTML5 and jQuery, without saving the file to disk server side?

Basically, I want to upload a file and process it immediately. I don't want to save it to disk, since there is no need to. It'll add a lot of potentially unnecessary code.

If so, does anyone have an example? I couldn't seem to find an example on Google, so I"m wondering if this is possible or not.

EDIT: I want to upload to the server and process there, without saving. I'm using PHP, with CakePHP

toast
  • 1,860
  • 2
  • 26
  • 49
  • Do you want to process it on the client, or upload to the server and process there (without saving ofc). If server-side, what server-side tech are you using? – freedomn-m Nov 04 '16 at 10:39
  • I want to upload to the server and process there, without saving. I'm using PHP, with CakePHP – toast Nov 04 '16 at 10:44
  • You should include that information in your question and tags (update the question). – freedomn-m Nov 04 '16 at 10:53

1 Answers1

0

Well, I think it is possible, according to this question answered by JayC

What you're talking about is the HTML5 File API. I'm not sure what is the best link to describe it, but this might help. https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications

And this question maybe can help you as well

Community
  • 1
  • 1
Kamae
  • 541
  • 2
  • 9
  • 19
  • Clarification made by the questioner: it's server-side processing rather than client-side. – freedomn-m Nov 04 '16 at 10:53
  • well this answer is still going to achieve the same result whether its server side processing or client side. In the linked answered question, the example creates a base64 string of the file, that could then be sent to the server, for processing. The reason I have accepted this answer already is I was wondering if someone else has a better answer, than converting to base64. As I imagine converting to base64 will add additional overhead. Might as well just do a normal file upload then. – toast Nov 04 '16 at 11:08