-
-
Notifications
You must be signed in to change notification settings - Fork 174
Open
Description
public void DownloadFile(string fileName)
{
string url = mainLink + "files/" + fileName;
string localPath = Path.Combine(DataManager.videosFolder + fileName);
if (!System.IO.File.Exists(localPath))
{
RestClient.Get(new RequestHelper
{
Uri = url,
DownloadHandler = new DownloadHandlerFile(Path.Combine(localPath)),
Timeout = 13,
Retries = 0,
IgnoreHttpException = false
}).Then(response =>
{
if (response.Request.downloadHandler.isDone)
{
Popup.main.DisplayMessage(Popup.Style.Blue, "Completed video download!", false);
}
}).Catch(ErrorHandler);
}
}
On an http exception ErrorHandler is called and code works, but the errored response is downloaded and stored as a file (Cannot GET /files/xx), do I have to delete it every time or am I missing something?
Metadata
Metadata
Assignees
Labels
No labels