It’s nice work… Probably some of you have already seen it… Anyway… I have gotten to a dead end.
Using the code in GitHub (no changes at all) I can connect, navigate, etc… BUT EVERY file I try to download is corrupted… I notice it immediately by the size and of course it doesn’t open nor run…
So… I need my desktop app to download some updates from my FTP… it’s a pity that I got it working except the download fails… I will not post code, because the tests I am doing here which are failing are with the GitHub code.
Maybe someone can give it a try… or a tip to let me download a file from my FTP without displaying the user/pass, of course…
I tested with both a text and a zip file and both files downloaded fine. Is there an encoding problem with the paths? But then no file would download. Can you post original file and downloaded file?
This is very odd. The downloaded file is indeed the original file, except that the last 2632 bytes are now at the beginning of the file. If you move the bytes back to where they belong the result is byte-for-byte identical to the original. I don’t understand how that could be happening unless the socket itself were delivering the bytes out-of-order.
What OS is the application for can you get the OS to FTP the file via a shell command? Does it need to be FTP can you HTTP the file from a web site instead?
Whatever works to download the file from my FTP… and actually if there is an alternative online solution other than my own FTP… that could also work as well… I just need the installed app to donwload its update…
It’s a windows app… I think I could use HTTP instead… I am just not sure how to check if the file it’s there…
How is this supposed to be done via HTTPSocket ? Sorry if this is a too noob question… I just don’t have and experience with this subject…
@Beatrix Willius : I’ve taken a look at Kaju, but it’s not as simple as I would like. To begin with I need to use it’s Admin app, which is yet another step to release the updates, but I’ve also tried that and couldn’t pass the error “Windows binary information is not correct. No hash available”.
I just need a simple solution to check if a file is online, and if its version (or name, version is also contained in the name) is newer , then download it and eventually install it.
if webSiteURL = “” then Return nil
if left(webSiteURL, 7) <> “http://” and left(webSiteURL, 8) <> “https://” then 'ensure the URL prefix is correct
webSiteURL = “http://” + webSiteURL
end if
if f = nil or not f.Parent.Exists then Return nil
tempBoolean = tempHTTPSocket.Get(webSiteURL, f, timeOut)
if tempBoolean and f <> nil and f.Exists and tempHTTPSocket.ErrorCode = 0 then
tempHTTPSocket.Close
Return f
else
tempHTTPSocket.Close
Return nil
end if