If I try to use CURLSMBS to download a remote file which does not exist, it bombs the app, even within a try…catch
Is there a way to check for the existence of a file on a web site before trying to download it?
(Doing an HTTPSocket.get will also download the file, which is large)
Hey Jeff. Here’s the content of a method with return type Boolean that I use for just such a purpose. I pass the URL to the method in a string. The method returns “true” if the file exists and “false” if not. Although I dimension a string variable for “DebugData”, I only use the resultant value of that for troubleshooting if needed. Hope it helps you.
[code] dim e as integer
dim d as new DownloadCURL
imgURL = ReplaceAll(imgURL, " ", “%20”) // NOTE: Spaces must be replaced with “%20” when using filenames having a URL
updatepath is the end filename.
In my tests, the ‘incorrect’ filename was dw.pkg and the correct one was db.pkg
When update path was dw.pkg, the app terminated without an error.
When it is correctly db.pkg, the whole thing works
Looks like i need a libCurl.dll file to make this work in Windows.
MBS site links to a dead page, and many of the pages about that being missing say ‘dont just download the dll as bad things may happen’
Any advice about where to get a 32 and a 64 bit version of this DLL file safely?
(Are there 2 distinct files?)
I use these precompiled 32-bit binaries when I use libcurl. They should work with MBS, but I haven’t tested. These are linked from curl’s official download page even though they are provided by a third party. I haven’t tried the 64-bit binaries that are listed.
Thats what the docs said, but I was finding that it didnt work.
I think I have traced it to an out of date plugin.
The .cancel property is missing , the percent parameter is missing, and the finished event isnt there either.
Currently downloading a new set of plugins and will flush the cache before retrying.
Good idea. 15.4 is much better than 10 year old plugins.
The mess with the DLLs always has been that there are old copies, copies with dependencies, copies without SSL/SSH libraries inside and copies with non matching bit number.
For the benefit of anyone finding this thread in the future, if a file does not exist, something is still downloaded, and it has a size > 0
What comes down is the resultant ‘404’ page of html.
So the downloaded file size can be checked for ‘bigger than x bytes’, and perhaps read in as a string for checking.
I’ve got things working with the new plugin. (My existing one was 3 years old but had not been used until I added this code.)
[quote=233376:@Jeff Tullin]For the benefit of anyone finding this thread in the future, if a file does not exist, something is still downloaded, and it has a size > 0
What comes down is the resultant ‘404’ page of html.[/quote]
Not sure how to do this with MBS, but you can tell libcurl to treat status codes that are greater or equal to 400 as a failure (i.e. nothing downloaded).