简体   繁体   中英

How can I download a zip file with a custom extension?

Most Indian companies block many sites and downloads like for zip and exe files. I found a solution to explore the zip file in Google Docs extentions and it works with most of zip files formats, but its very lengthy to download or copy files one by one.

How can I download a zip file from a URL with alternate extentions using C#?

I am not looking for a proxy. A solution for websites only is also acceptable. I will make those changes on my site and than the site will alow the user to download the file using other extension.

不确定您到底在做什么,但是您始终可以下载文件的下载字节,然后根据需要进行下载,包括使用新的文件扩展名进行保存。

WebClient makes it pretty easy to download files.

string query = "http://website.com/my.zip"
string output = "C:/Downloads";
using (var client = new WebClient())
{
    client.DownloadFile(query, output);
    return true;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM