Drag files from the desktop

It doesn't matter if you do all the error checking in the world, or if you have the most beautiful graphics, if your site or application design isn't usable, it's not going to do well. Get input and advice on usability and user interface issues here.

Moderator: General Moderators

Post Reply
lewindha
Forum Newbie
Posts: 6
Joined: Wed Apr 07, 2004 10:03 pm

Drag files from the desktop

Post by lewindha »

Hello all

Quick question. I'm developing a content management system for my company. I was wondering if it is possible to drag files from the desktop into a listbox or some other html control to upload the files.

I'm pretty sure this is impossible, but I wanted to ask just in case.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Drag files from the desktop

Post by RobertGonzalez »

lewindha wrote:I'm pretty sure this is impossible, but I wanted to ask just in case.
I think you are right when you say it is impossible. I'm not sure even AJAX would be able to help here.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

it can't be done with standard html.

you might be able to write an activeX control or a java applet that would allow you to do it...but I've never seen one.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

I'm oging to say...it's possible...however not cross browser friendly or portable...but possible

ActiveX...in which case your bound to Windows...I'm sure there are port projects...but none are likley to offer support really required by ActiveX/COM...as thats a monumental task...

Anyways:

http://www.sitescripts.com/ASP/File_Man ... pload.html

Best that I could find...but it's an ActiveX control...

That activeX control likley requires your user to use the ActiveX control interface to upload files...in which case you likley have to initialize it with your FTP credentials...

Which is a security risk...especially if it's initialized in javascript...this is a guess, but I'd look into it...ask how the control knows how to upload...and to where...

Likley you want your users to drag and drop without authenticating...or even know your using such a control altogather...

If memory serves me correctly...Internet Explorer included a COM object called FSO which basically let you manipulate/read a clients file structure...obviously...if my memory does serve me correctly...Windows will warn your users about what is going to happen...as it's a security risk...

With FSO you should be able to scan a local HDD for files using javascript...and if you can indeed open and read files there are techniques you could use to upload multiple files at once...like a drag and drop...

This is just an idea...what I once considered doing in a previous situation many moons ago...not sure if there are other limitations like FORM length limitations on IE, etc...all i'm sure can be circumvented with enough homework ;)

Anyways, using FSO you read the files contents and create a HIDDEN form element and set it's content to that of the FSO read operation.

When you submit a form, along with it goes all the files details or just content depends on how you format HIDDEN fields...

Basically, at a minimum, when you read the file via FSO...you should store it's name/path and contents in each HIDDEN field thus they can be re-created at FORM submittion on the server side :)

Here is a simple tutorial on FSO: http://www.codeproject.com/jscript/search_in_files.asp

But thats your choice...

This solution isn't perfect but with enough AJAX-ing and FSO-ing you *could* implement a complete drag and drop upload system...

I have one cross platform, cross browser solution up my sleeve...but a magician doesn't expose all of his secrets... ;)

Muahahahahahaha :twisted:

BTW: Here is another article that might be of interest: http://www.15seconds.com/issue/010522.htm
http://www.tutorial-web.com/asp/fso/index.asp

HTH

p.s-It just occured to me...Flash is likely an ActiveX control...annnnd you can view Flash in FF...so maybe it is possible on any platform or at least a browser oterh than IE :P

Cheers :)
lewindha
Forum Newbie
Posts: 6
Joined: Wed Apr 07, 2004 10:03 pm

Post by lewindha »

Thanks for all of the help.

I figured if it could happen, it'd be some sort of ActiveX control or I would have to use the ftp functions. I'm gonna look into the flash thing, but more likely gonna tell the boss it's too risky right now.
Post Reply