HTML5 Drag n Drop File Upload?

Rather than code this from scratch, why not use something like html5uploader, which works via drag n drop (uses FileReader etc. ): code.google.com/p/html5uploader.

1 BTW, that doesn't seem to be a Google project. – therefromhere Jun 28 at 21:27 Yeah OK, corrected. – Ben Poole Jun 29 at 5:58 I'll give it a try.

Thanks :-) – Paris Jun 30 at 16:20.

You'll want to extract the base64 encoded file contents and ajax them over tot the server. JavaScript var extractBase64Data; extractBase64Data = function(dataUrl) { return dataUrl. Substring(dataUrl.

IndexOf(',') + 1); }; // Inside the ondrop event Array.prototype.forEach. Call(event.dataTransfer. Files, function(file) { var reader; if (!file.type.

Match(options. MatchType)) { return; } reader = new FileReader(); reader. Onload = function(event) { var contentsBase64; if (event.target.

ReadyState === FileReader. DONE) { contentsBase64 = extractBase64Data(event.target. Result); return $.

Post(someURL, { contentsBase64: contentsBase64 }); } }; reader. ReadAsDataURL(file); }); CoffeeScript extractBase64Data = (dataUrl) -> dataUrl. Substring(dataUrl.

IndexOf(',') + 1) # Inside the ondrop event Array::forEach. Call event.dataTransfer. Files, (file) -> return unless file.type.

Match(options. MatchType) reader = new FileReader() reader. Onload = (event) -> if event.target.

ReadyState == FileReader. DONE contentsBase64 = extractBase64Data(event.target. Result) $.

Post someURL, contentsBase64: contentsBase64 reader. ReadAsDataURL(file).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions