Jump to content

drag and drop to web folder from client machine


sajan

Recommended Posts

Hi, Can we drag and drop to a web folder from client machine.Thats i open the browser ,then drag a file or folder and drop it to the browser.Then the folder or file automatically uploaded to the web folder.Is it possible?Also how can i display the contents of a folder in tree structure.(both in client and web folder).thanks

Link to comment
Share on other sites

In order to display the contents of the users machine it would require them giving your webpage permission to do so or else you will not be able to read their folders.There are many javascript treeviews out there. ASP.Net 2.0 alos comes with one built in so you can manipulate it with server side code.

Link to comment
Share on other sites

Umm, now hang on a tick - do you want users to be able to interact between windows explorer and the web browser, i.e. open an explorer window and drag the file into an area in the browser? If so, I'm not sure whether you can do that... :) But with two areas in the browser, one for local files and one for remote files, I believe it is possible.Also, by using Ajax you are using JavaScript anyways, and with document trees a JavaScript solution is always much smoother than a PHP one.

Link to comment
Share on other sites

two areas in the browser, one for local files and one for remote files, I believe it is possible.
That is what i want.can u give me the code.(also can u give me the code of folder listing with unlimited level like windows explorer).thanks
Link to comment
Share on other sites

I somehow managed to solve the client part.Now i have another problem.When i drag and drop to the browser the dropped fills entire window of browser.How should i restrict it to a particular area?Also how can i capture the path and file name of the dropped item?thanks

Link to comment
Share on other sites

If you're talking about listing a directory on the client, I don't have any code samples for that and I'm not aware of any that are online, I'm sorry. If you want to list a directory on the server, there are several examples online of using languages like PHP, ASP, or ColdFusion to do that.The problem with accessing the filesystem of the client machine is security. Obviously it would be a big security problem if any website could read the files of the client machine. So, if this is going to be done through a web browser then you need to use a plugin architecture that gives you access to the filesystem of the client machine, and Java is probably the most widespread. Not everyone has Java, but it's the most widespread.Also, you keep specifying drag-and-drop but I'm not sure you could do that even with a Java applet. If you drag a file onto a Java applet on a web page, you are dragging the file into the web browser application window. When you do that, I think the web browser is still going to open the file instead of passing the file through to whatever content you dragged the icon onto. You can do a folder view and have them select a file, but don't count on being able to do a drag-and-drop to an applet through a web browser.

Link to comment
Share on other sites

May be this hint useful to many.The xpcom component of firefox allows javascript to manipulate file in client side(ofcourse certain permissions to be satisfied).There may be some thing like the xpcom in other browser also.Hope this will help .

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...