Does not download file if I'm replace my own url with yours
IAmMonika opened this issue · 13 comments
More info needed.
I uploaded a song list on GoDaddy server and then download song from that GoDaddy server url. That time I got the issue.
Download progress is not display and resume download functionality is also not working
Please try to download mp3 file from this like "http://starindustries.co/assets/mp3/waka.mp3" you got the issue. And pls tell me how to solved this issue.
Give me solution as soon as possible
Sir please please please give me solution.
Resume functionality depends on server support. If the server does not support download start with an offset, resume does not work.
Apparently download progress reporting depends on server behavior as well. If the server does not provide downloading in chunks, download is not reported. You might want to try downloading a very big file from the GoDaddy server to see if download progress is reported then.
Actually
- (void)URLSession:(nonnull NSURLSession *)aSession downloadTask:(nonnull NSURLSessionDownloadTask *)aDownloadTask didWriteData:(int64_t)aBytesWrittenCount totalBytesWritten:(int64_t)aTotalBytesWrittenCount totalBytesExpectedToWrite:(int64_t)aTotalBytesExpectedToWriteCount
is called multiple times, but with aTotalBytesExpectedToWriteCount
set to -1.
The server does not report the expected total file size. Therefore no progress can be calculated.
But when I try to download .png or .jpg file from GoDaddy server, then download progress is display. Hows it possible ???
As I said: Depends on the server.
@Heikowi It is not server issue. Because same url is working on Android and If I used other iOS library then url is working well and display download progress also
Thank you for the info. What other iOS library do you mean? Can you provide a name or link please?
as i fix that in other method by setting[request setValue:@"identity" forHTTPHeaderField:@"Accept-Encoding"];
but that wont working on this libraray that return -1 how to fix this ?
@Heikowi Hello, Please, Download demo from this link "https://drive.google.com/file/d/0B6z9HygTZ-TJNWlHeWZLc2FtVUk/view?usp=sharing" and check download progress is display perfectly.
Thank you for the sample project!
Please update and see my commit cce3bce for a sample of how to customize the http header values.
With the customized header values, a download progress is displayed with HWIFileDownload when downloading the GoDaddy sample file http://starindustries.co/assets/mp3/waka.mp3
Download is displayed then because the data is served uncompressed when sending
"identity"
for "Accept-Encoding"
. Apparently the server is unable to tell the file size when serving compressed data.