1
Answer

File Drag & Drop from Mozilla Firefox

henri

henri

20y
2.3k
1
Hello everyone. I have a problem with my program when I try to drag&drop a file from Mozilla Firefox, for example a picture. Although dropping works great when I drag the file from Explorer or Internet Explorer. My program is simply supposed to copy the file dropped to a predefined location. Now, when I try to drag from Firefox, my program gives an exception from System.IO.File.Copy, for example like this: Could not find file "c:\docume~1\user\locals~1\temp\picname.gif" And the program is absolutely right, there really is not such file on the folder. Still, if I drag the picture from Firefox directly to any folder, it works. So how can I have an access to file dragged from Firefox? I use a ListBox.DragDrop and my DragEventHandler loops the files like: foreach ( String file in ( String[] ) e.Data.GetData( DataFormats.FileDrop ) ) I think this problem of mine is somehow related to the different ways of using cache between these two browsers. If you have a neat solution, now it's a good time to share it. Or it does not even have to be so neat... Thank you.
Answers (1)
0
henri

henri

NA 3 0 20y
And the journey continues... Sometimes it works fine, it finds the file as expected and copies it successfully. But not always. And there's some more weird behaviour. Some pictures which looked OK in the browser and were successfully dragged through my program look afterwards like they were never downloaded completely. Then again, when I dragged the same picture without reloading directly to a folder in Explorer, the picture becomes OK again. The name of the dragged file seems to change also from time to time, although this could be some kind of new feature in Firefox. It adds numbers at the end of the original file name. I really do hope this is a bug in Firefox(I'm using 0.10.1). Atleast for now I cannot find out any other conclusion. Now my head is really starting to feel sick. And when a head as big as mine gets sick it really is sick... Any thoughts?