Error 404 and ASIHTTPRequest download to file
As recommended in ASIHTTPRequest documentation, I use "setDownloadDestinationPath" to download images from remote server. In some situation the server answer an Error 404, file not found. The Error 404 page is then donwloaded in local file.png for example...
What is the recommended开发者_运维百科 way to avoid such behaviour ? How to manage to not create image if the file does not exist on server ?
Thanks for your help !
Solved (detail bellow)
The magick key word is [request responseStatusCode] --> A valid OK HTTP response code is 200. For other codes I just delete (using NSFileManager) the created file.
Hope it can help others
kheraud
The magick key word is [request responseStatusCode] --> A valid OK HTTP response code is 200. For other codes I just delete (using NSFileManager) the created file.
Hope it can help others
kheraud
精彩评论