Submitting an image to a form by dragging & dropping

J

joe

I have an image database that I'd like to populate by dragging an image
off the desktop and
dropping onto a form (cut/paste would work equally as well)

Any suggestions?

Thanks,

Joe

joe at via.et
 
K

kaeli

I have an image database that I'd like to populate by dragging an image
off the desktop and
dropping onto a form (cut/paste would work equally as well)

Any suggestions?

Is there a reason the file input type isn't appropriate for this?
If so, Google is your friend -- search drag and drop and you get lots of
options. If not, just use the file input type.

http://www.google.com/search?hl=en&q=javascript+drag+and+drop

Keep in mind that in general, client-side code cannot talk to a server-side
database. You'll have to handle the image with server-side code (which means
a form submit, generally speaking) once it's loaded onto the page, whether
that be via drag and drop or a simple file input type.

If this code is all on your client, including the database (i.e. HTA or CD
application), say so. That's different. :)

--
 
J

joe

Kaeli,

Yes, I did search google for this. All of the hits were about dragging
images already inside the browser window. A crossword puzzle is a good
example of that.

What I want is file input type, but instead of having to navigate
through the file hierarchy using a file
browser and then selecting the file, I would prefer to drag it's icon
off the desktop and drop it onto a
target area of my javascript application. It's much easier that way if
you have hundreds of image files to upload.
 
K

kaeli

Kaeli,

Yes, I did search google for this. All of the hits were about dragging
images already inside the browser window. A crossword puzzle is a good
example of that.

What I want is file input type, but instead of having to navigate
through the file hierarchy using a file
browser and then selecting the file, I would prefer to drag it's icon
off the desktop and drop it onto a
target area of my javascript application. It's much easier that way if
you have hundreds of image files to upload.

*plays around a bit*

I don't think you can do this in this manner, as dragging a file onto MSIE is
already handled by MSIE and it opens it. Firefox doesn't, but you get a funny
little icon that indicates you can't do it.
Although I might easily be missing something.

Although this seems tedious in the extreme for hundreds of files.
Put the image files in a directory and move it with FTP or something
(filezilla or cuteftp come to mind).
If you MUST use http protocol, make a little Java [or HTA or other
language/application of choice] program to http upload the files in the
directory.

This is SO not a way to move hundreds of any kind of files, in any case.
That's what FTP is for. Making someone drag hundreds of files one at a time
isn't a very viable solution, IMO.

--
 
C

Csaba Gabor

On my Win XP Pro Firefox (taken from a nightly build: ... rv:1.8b2)
Gecko/20050320 Firefox/1.0+) if I drag a .jpg image from the desktop
over the browser client area, I get a rectangle with a fuzzy border.
If I release at this point, the browser displays the .jpg file,
replacing the previous page, to which I can return with the back arrow.

Csaba Gabor from Vienna
 
M

Matthew Lock

It's a java applet, but I have heard good things about this:
http://jupload.sourceforge.net/

It acts as a more sophisticated file upload control. From memory it
allowed you to drag and drop multiple files into it and displayed a
progress bar during the upload.

Matthew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top