Can not download file correct!

Hi,

I am making a tiny sample project. It will be download a file from a direct link. This is my code:

This code can download file, save to desktop with name “sample.apk”. But this file’s size is only 180 bytes. The original one is 42MB

Can anyone explain that? Thanks.

Look into the downloaded file :

[code]

301 Moved Permanently 301 Moved Permanently

A.T.A [/code]

Thanks @Michel Bujardet very much :smiley:

You have to follow the redirects if the HTTPStatusCode is 3xx. Check the location header in page-headers to get the new URL, which you will have to visit again.