0

How to start uploading after choosing a file, but not submit the form?

I did a search and found there are many similar solutions, but they all submit the form.

The problem is, that I don't want to submit the form so early because there might be other fields need to be filled out.

Ian Y.
  • 2,293
  • 6
  • 39
  • 55
  • And why do you want to upload the file if the form isn't properly filled out ? – adeneo Mar 02 '14 at 09:06
  • than don't submit the form but just call a function to send the image to the server... On form submit than you have the file input value... But any way, strange question – Roko C. Buljan Mar 02 '14 at 09:07
  • @adeneo, that's a Drag and Drop upload area, and I want to make it also being able to select a file and upload immediately. – Ian Y. Mar 02 '14 at 09:10
  • @RokoC.Buljan, is there a tutorial? I'm not a javascript expert. – Ian Y. Mar 02 '14 at 09:11
  • There's many examples online, search for formData object and ajax file upload, and you'll find them. – adeneo Mar 02 '14 at 09:13
  • @adeneo, I know there are many plugins online. But the Drag and Drop one I currently use is [html5demos's](http://html5demos.com/dnd-upload). Is it possible to make two methods work together? – Ian Y. Mar 02 '14 at 09:15
  • @IanY. the demo you're using is pretty messed up – Roko C. Buljan Mar 02 '14 at 09:22
  • @IanY. might something like this help? http://stackoverflow.com/questions/12570834/how-to-preview-image-get-file-size-image-height-and-width-before-upload – Roko C. Buljan Mar 02 '14 at 09:23

0 Answers0