Drag and drop from web to desktop app

As the title says, can you drag an object from a web page, ie picture and drop it into a xojo desktop app?
yes/no/ or yes but its a huge pain to do so dont bother
Thanks
Hamish

Yes. My understanding is that drop objects are easy to work with too.
There’s some Drag&Drop examples in the Xojo download.

Example Projects/Desktop/DragAndDrop/

I can get the listboxes example to work, but not the listbox example where you can drag from the desktop.
This is on windows 7. From memory it worked on my OSX, will have to try that later…
Hamish

Apparently on Windows Text drop works but when it comes to dragging pictures from a web site, DropObject fires but Obj.PictureAvaiable remains false, and Ob.Picture nil.

The workaround is to make the canvas AcceptTextDrop, which in DropObject gets the URL of the picture. Then you can fetch it with HTTPSocket.

You may get a file drop as it may temporarily download it and then you get the folderitem

I checked that but Obj.FolderITemAvailable stays false as well. I did make sure that me.AcceptFolderItem be in Open

“Absolute answer”:

YES YOU CAN.

But YMMV depending on the used browser and the data you ’re trying to drop.

Text (either from the html, web page or from a TextArea): I do that very often in an application (or two):
I select all the TextArea contents (from the web page in both FireFox and Safari - OS X), drop a single field flow of lines into my application ListBox and it works fine. *

Text coded in html (standard text) drop into a TextField / TextArea works fine too. BUT:
styled text disappears (I think) when dropped from FireFox **
styled text drop are ok from Safari. **
images drop on a canvas does not works from FireFox,
images drop on a canvas worksfine from Safari.

I’ve made these testings (styled and images) last year, so there can be difference(s) with current versions.

Ask me if I was not crystal clear.

‘*’ I checked that under Windows 8.1: works OK.
‘**’ Not checked on Windows 8.1.

About the reason why I built an application to get data from web pages

All I wanted was to stop saving web pages into my hard disk with its plethora of css, js, etc. files that are a plea when yu start to search someting from your hard disks (I had to exclude then: -js -css etc.).

But, after a while, it started to be a boring task (to drag and drop images and styled text, then saving these to disk (as rtf / png files, but in one click only) and so I stopped to use them.

Think: “Emile is getting movie text (Cast, Résumé, Descriptions, etc.) and movie images (Poster, Photos, etc.) from web sites. Useful, but as I wrote earlier: boring.

If only these sites does not have so many ads and useless (for me) data, I would download and analyze the html data and keep (save to disk) only what I want… (Text descriptions and Images/Photos).

39742 - On Windows dropping a picture from a web site pictureavailable does not get True

<https://xojo.com/issue/39742>

Update to my comment above (thanks to Michel sample project):

Drop an image from a web site / Firefox (38.0.5) onto Michel’s Canvas/Project works fine now.

[quote=194391:@Emile Schwarz]Update to my comment above (thanks to Michel sample project):

Drop an image from a web site / Firefox (38.0.5) onto Michel’s Canvas/Project works fine now.[/quote]

I am sorry, pictures simply do not work at all from FireFox Windows. Neither do they from Internet Explorer. It does show you can drop an image from Chrome, but then PictureAvailable remains false, and there is no Obj.Picture.

Also, the workaround I was describing does not work as soon as the picture is used to link, because then the text received is the link destination, not the address of the picture. Only when a picture is not linked would it give the picture URL in Obj.Text.

I also tried to drop an image over an HTMLViewer, but it does the same : open the link instead of the picture.

Xojo really needs to fix the bug, if this is at all possible.