Success=ReceiveHTTPFile(.......)
Success delivered in previous Versions the length of the received file
Now in 5.41 it is always 1 if it was ok
Was there a reason to change that?
Now it needs an additional FileSize() to make a quick check if the website/image/script-return has changed ...
ReceiveHTTPFile - Not really a Bug - therefore here
ReceiveHTTPFile - Not really a Bug - therefore here
--------------
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
Re: ReceiveHTTPFile - Not really a Bug - therefore here
If the file was empty, it would have return 0, even if the file was successfully created on disk. That's why it has been changed (the doc never specified it returned the length anyway).
Re: ReceiveHTTPFile - Not really a Bug - therefore here
Why not return -1 if no file has been downloaded?
This seems to fit better to the "PB-way" from my point of view (see FileSize() e.g.).
But anyway, this is more a Feature-Request and I would be the second one who would prefer it like this.
This seems to fit better to the "PB-way" from my point of view (see FileSize() e.g.).
But anyway, this is more a Feature-Request and I would be the second one who would prefer it like this.
{Home}.:|:.{Dialog Design0R}.:|:.{Codes}.:|:.{History Viewer Online}.:|:.{Send a Beer}
Re: ReceiveHTTPFile - Not really a Bug - therefore here
It does make sense to have files that are 0 Bytes long
I. e. a simple empty index.html in a subfolder of a webserver prevents that the file list is displayed if several settings on apache, php etc. are not complete or missing ...
That's why a Zero Result = ReceiveFTPFile(#Ftp,...) on Failure is wrong anyway ... it should be -1
FTP Programs transfer 0 Byte sized files without reporting errors ...
If you want to open a file you make If FileSize(-1, "file") > 0 anyway (you do not need an empty file with 0 Bytes to be opened (because you know what you get) and not one which does not exist -1)
The same happens to a downloaded website or image or echo of a php script ...
It was simple for years to check by a certain size of the file without opening it to know how to further handle interaction with php scripts without the extra command FileSize
Usually most things which have to do with network are based on how many Bytes are received or sent ... makes sense ... that happened with HTTP in the past ...
That's why I asked, if it has a special reason you changed it ... and made it incompatible with previous Versions ...
Although you never said it in the manual .. there are many things not told explicitly in the manual and still work ...
I. e. a simple empty index.html in a subfolder of a webserver prevents that the file list is displayed if several settings on apache, php etc. are not complete or missing ...
That's why a Zero Result = ReceiveFTPFile(#Ftp,...) on Failure is wrong anyway ... it should be -1
FTP Programs transfer 0 Byte sized files without reporting errors ...
If you want to open a file you make If FileSize(-1, "file") > 0 anyway (you do not need an empty file with 0 Bytes to be opened (because you know what you get) and not one which does not exist -1)
The same happens to a downloaded website or image or echo of a php script ...
It was simple for years to check by a certain size of the file without opening it to know how to further handle interaction with php scripts without the extra command FileSize
Usually most things which have to do with network are based on how many Bytes are received or sent ... makes sense ... that happened with HTTP in the past ...
That's why I asked, if it has a special reason you changed it ... and made it incompatible with previous Versions ...
Although you never said it in the manual .. there are many things not told explicitly in the manual and still work ...

--------------
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg