… is the indication that the compiler cannot decide which of the HTTPSocket.Get methods to use. Usually this is because one of the arguments is not of the correct type.
By the way your comment in the code above says that picture1 is a folderitem in a property, not pictureFile…
Eli - yes, that is what I thought and have been looking for my error, but I can’t see it. And yes, my comments in the code didn’t quite keep up - it is meant to refer to pictureFile not picture1
Tim - no, the code is a direct copy/paste from Xojo - there is no call.
Ah, I think you’ve found my duh moment. Sock1 was just a subclass of httpSocket to get access to the downloadComplete event. It would appear that it needs instantiating or adding to a layout to get it to work.
I have finally got the socket to work, but not in the way I had expected.
I had expected to use httpsocket.get(URL) followed by downloadComplete event to get the associated download file. But this event doesn’t seem to fire, nor does the error event.
The only event that seems to fire after .get is .pageReceived. At least that contains the content which can be converted to a memory block and then into a picture, if you happen to already know the size of the picture.
Is there a trick to getting downloadComplete to fire?
[quote=192856:@James Pitchford]I have finally got the socket to work, but not in the way I had expected.
I had expected to use httpsocket.get(URL) followed by downloadComplete event to get the associated download file. But this event doesn’t seem to fire, nor does the error event.
The only event that seems to fire after .get is .pageReceived. At least that contains the content which can be converted to a memory block and then into a picture, if you happen to already know the size of the picture.
Is there a trick to getting downloadComplete to fire?[/quote]
From what I understand in the LR, DownloadComplete has a FolderItem property. That could imply it fires only when Get is used with a Folderitem. Which would make the name logical. You may want to try
HTTPSocket.Get ( URL As String, File As FolderItem )
Different events will be raised depending on the version of Get that you call. Get(String, FolderItem) raises the DownloadComplete event; Get(String) raises the PageReceived event.
That is certainly what I expected on reading the manual. But in my example get(string, folderItem) is raising the PageReceived event and not the downloadComplete event.
Interestingly, when called, folderItem is nil - and the PageReceived event is raised.
However, if I instantiate a folder item, then the Error event is raised - code 1.
That is certainly what I expected on reading the manual. But in my example get(string, folderItem) is raising the PageReceived event and not the downloadComplete event.
Interestingly, when called, folderItem is nil - and the PageReceived event is raised.
However, if I instantiate a folder item, then the Error event is raised - code 1.[/quote]
That is certainly what I expected on reading the manual. But in my example get(string, folderItem) is raising the PageReceived event and not the downloadComplete event.
Interestingly, when called, folderItem is nil - and the PageReceived event is raised.
However, if I instantiate a folder item, then the Error event is raised - code 1.[/quote]
So you’re clear that you need to pass a valid, writable folderitem right? And it needs to point to a file, not a folder.