Folder item? Why not just download the file the way the rb example
does,
Make a TCP socket. Set it to httpsocket.
Call it with:
socket1.get("http://mydomain/Updates/myfile")
Then in the socket1 PageReceived event, you can access the entire
download to compare against your current version:
myVersionNumber = content
Not sure what u need the folderItem for.
But you still need to make some accomodations for timeout in that, or
check to see if they are connected to the internet. So if your user
doesn't have a network connection you don't crash the program.
RB has a call with timeout:
Basically something like:
dim response as string
h = new HTTPSocket
response = h.get("http://blahblah/file.txt",30)
if (len(response)>1) then
And it should timeout after 30 seconds.
I realllly don't like the RB httpclass. The timeouts and asynch
stuff is marginal, and typically hangs my program when trying to do
sockets over a wireless (cellular) connection.. If you're mac only, I
strongly recommend using Curl or Wget instead through the console/
system interface. Much much more reliable. But hopefully the above
will work for u,
tim
On Jul 3, 2006, at 12:32 PM, Craig Hoyt wrote:
I'm trying to implement on of those 'check the web for newer
version' routines. I have a text file that contains just a version
number on my web site. I use HTTPSocket to retrieve this file and
compare against the current version of my app. All this does work.
If my app has a newer version I have a button appear in my about
window which should let the used download a newer version to their
desktop. I'm getting a error of 1 and it is reported immediately
where I would expect a small delay before reporting an error. I
can't seem to find out what error 1 is. All HTTP errors are in the
hundreds range. If I use the HTTP RB example I can download the
file but not from my app. Here's the code I'm using;
Dim mySocket As New HTTPSocket
Dim f As FolderItem
f = DesktopFolder
If f <> Nil then
mySocket.Yield = true
mySocket.Get( "http://mydomain/Updates/myfile" , f)
else
beep
end if
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>