2009-08-26 63 views

回答

0

我真的不知道你在問什麼。您是否問過如何使用fileupload控件將通過URL引用的文件上傳到您自己的服務器?

1

只要有一個文本框您的網頁上,讓他們進入一個URL,然後提交表單時做到這一點...

string url = YOUR_TEXTBOX.Text(); 
Uri uri; 

try { 
uri = new Uri(url); 
} 
catch (UriFormatException ex) { 
// Error 
throw ex; 
} 

byte[] file; 

using (System.Net.WebClient client = new System.Net.WebClient()) { 
file = client.DownloadData(uri); 
} 

// now you have the file 

當心上傳病毒:)