- Home /
Question by
shweta-unity · Jun 13, 2019 at 02:23 PM ·
androidiosdownloadingzipwebclient
Downloading file using web client not working in all servers
I am using web client to download zip file to my game.
But the file is getting downloaded from my server but not with my client's server.
Here is the code which i am using.
public void DownloadAndSaveZip(string m_zipURL, string m_zipFilePath, string m_zipFileNameToSave)
{
Debug.Log("DOWNLOADING ----------- " + m_zipURL);
WebClient client = new WebClient();
client.DownloadFileCompleted += SuccessResponse;
client.DownloadProgressChanged += Client_DownloadProgressChanged;
client.DownloadFileAsync(new Uri(m_zipURL), m_zipFilePath + m_zipFileNameToSave);
}
private void Client_DownloadProgressChanged (object sender, DownloadProgressChangedEventArgs e)
{
Debug.Log ("Client_DownloadProgressChanged " + _progressAmount);
}
void SuccessResponse(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
Debug.Log("Complete............");
if (e.Error == null)
Debug.Log("If............");
else
Debug.Log("Else..........");
}
While using my server url for same file, it shows download progress but while using my client's url it directly calls DownloadFileComplete method with file size of 0.
I have uploaded same file to both servers and both uses linux.
Any help would be great.
Thanks!
Comment