Page 1 of 1

DownloadFile without URL

Posted: Fri Mar 12, 2021 5:59 pm
by amyren
I use an external file to store the server url, and load my ftp adress info a variable serverconfig$ to use with DownloadFile.
My current usage is to load a top10 highscore list from a server and into a virtual file. This works well, and also using UploadFile to update the file on the server.
Then I found that if serverconfig$ contains only a filename, without a network address then it will work by loading a local file.

Since the documentation says that the url$ argument must begin with http or ftp prefix, I wonder it this is a hidden feature in DownloadFile or just a coincidence? (UploadFile does not accept just a filename as an argument.)

Re: DownloadFile without URL

Posted: Sat Mar 13, 2021 11:41 pm
by airsoftsoftwair
Can't reproduce this... I always get the error "Unknown protocol in URL!" (as expected). MCVE please.

Re: DownloadFile without URL

Posted: Sun Mar 14, 2021 6:40 pm
by amyren
My mistake.
I found I had ExitOnError set to False earlier so I didnt notice the error, and when the virtual file didnt exist the file was opened locally by openfile later. I have some mess to clean up there.