1

I'm trying to make an upload holder for my website, so users can easily drag and drop a file on it.

there is a lot of libraries and events for doing that, but I need a simple way.

this (thought) came to my mind...

I put a file input to the page and sets width and height.

now when my user drag a file on it, onchange event will work.

but I want to hide browse button and there is two way:

set 0 opacity.(it is not working in some browsers)

set hidden visibility.(the thought is not working)

help me, what else I can try?

1
  • I would suggest shadow DOM, but that's hardly a working draft. Commented Jan 17, 2013 at 23:04

1 Answer 1

1

Put the form on a hidden iframe. Use an ordinary div for the target. When the file is dropped, catch the event and update the input, then submit as post. The result is ajax-like uploading via file drag and drop.

Sign up to request clarification or add additional context in comments.

1 Comment

Or you can use the FileReader to read the file when dropped and upload it with the new XMLHTTPRequest level 2 standard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.