sajan Posted July 31, 2007 Share Posted July 31, 2007 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 More sharing options...
aalbetski Posted July 31, 2007 Share Posted July 31, 2007 You can using FTP protocol. There are some existing products out there that do exactly this. I use Filezilla myself. Link to comment Share on other sites More sharing options...
aspnetguy Posted July 31, 2007 Share Posted July 31, 2007 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 More sharing options...
sajan Posted August 2, 2007 Author Share Posted August 2, 2007 Thanks for your reply But i need to code it using ajax and php.The user is already authorised.So we have to write a code that drag and drop and automatically update the web folder. Link to comment Share on other sites More sharing options...
Synook Posted August 2, 2007 Share Posted August 2, 2007 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 More sharing options...
sajan Posted August 2, 2007 Author Share Posted August 2, 2007 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 More sharing options...
justsomeguy Posted August 2, 2007 Share Posted August 2, 2007 You can't use Javascript to read files on the local computer, that's just not something that Javascript is able to do. Link to comment Share on other sites More sharing options...
sajan Posted August 3, 2007 Author Share Posted August 3, 2007 Ok then, can we directly access the browse button of type file? (using dom or anyother?).thanks Link to comment Share on other sites More sharing options...
sajan Posted August 3, 2007 Author Share Posted August 3, 2007 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 More sharing options...
justsomeguy Posted August 3, 2007 Share Posted August 3, 2007 You can't. When you drag and drop a file into the web browser, it is the same thing as doing File -> Open. You can't capture that with Javascript. Link to comment Share on other sites More sharing options...
sajan Posted August 4, 2007 Author Share Posted August 4, 2007 Can u suggest me any other solutions for this.(Other than using java applet). Link to comment Share on other sites More sharing options...
justsomeguy Posted August 5, 2007 Share Posted August 5, 2007 It would either have to be Java or an ActiveX component, which would only work in IE. Link to comment Share on other sites More sharing options...
sajan Posted August 6, 2007 Author Share Posted August 6, 2007 can u give me or point me to the code for (1)dynamic directory listing and (2)drag and drop using java or java applet.thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted August 6, 2007 Share Posted August 6, 2007 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 More sharing options...
sajan Posted August 6, 2007 Author Share Posted August 6, 2007 Thanks for your reply.Also pls visit the link http://www.radinks.com/upload/(i think it shows drag n drop upload with applet) Link to comment Share on other sites More sharing options...
justsomeguy Posted August 6, 2007 Share Posted August 6, 2007 I guess it depends on the browser. IE and Firefox will pass the file through to the applet, Opera will not. Link to comment Share on other sites More sharing options...
penguine Posted August 7, 2007 Share Posted August 7, 2007 i heard that using flash player the drag n drop can be done. Link to comment Share on other sites More sharing options...
sajan Posted August 14, 2007 Author Share Posted August 14, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.