Check if it is possible to download file with delphi
Good day ... I'm starting in Delphi and I am creating a program to download files from HTTP ...
I'm using:
IdHTTP.Get (URL FileDownload)
But my program generates error when it can not download the file ...
Ex: http://exemplo.com/ -> Generates Error
Ex: http://exemplo.com/meudownload.ts -> Makes download
I'd like to correct this error, how can I check if it is possible to download the file or if it is being lowered ...
I used EIdHTTPProtocolExeption
but only checks HTML error like: 404, 300 ... and is not that I wish ...
I would like to see if you can download the file, or if it is being downloaded ...
If this happens I will download other file:
donw_1.ts, down_2.TS, down_3.TS ... then when he gets el Archiving one that can not be downloaded, I have the answer to cancel the loop ...
Unable to solve the problem by doing a scan HEAD ... and managed to solve the problem with the HTTP 404 error .... where there was no file to download it generates this error EIdHTTPProtocolExeption ... the problem has been resolved ....