Link to home
Start Free TrialLog in
Avatar of steam23
steam23Flag for Canada

asked on

Upload from URL, not local file system

Have to admit, I know nothing about .NET and come from a classic ASP world as far as server-side programming goes... Anyway.

What we're looking to do is to upload an image from a user provided URL to server, rather than prompting user for a file on their computer.

To demonstrate behaviour:
have a look at http://imageshack.us/

upload: http://img.youtube.com/vi/PTU2He2BIc0/default.jpg

results in the image being hosted at:

http://img440.imageshack.us/img440/8094/defaultgh3.jpg

The company that I now work for is a .NET shop that has recently migrated to 2.0 and uses a third party component http://www.powupload.com/ for it's current uploading needs.

Thanks for your thoughts.

N
Avatar of Solar_Flare
Solar_Flare

to do this you would just use a TextBox to enter the URL, then when a button is clicked you would get the server to retrieve the file at the given URL

eg


void UploadHandler(object sender, eventargs e)
{
   if(Textbox1.text != string.empty)
   {
      System.Net.WebClient c = new System.Net.WebClient();
      byte[] imageBytes = c.DownloadData(TextBox1.Text);
      //now save imagebytes or whatever
   }
 
}

Open in new window

Avatar of steam23

ASKER

I guess this would be customizing of how powupload handles being passed a string?
ASKER CERTIFIED SOLUTION
Avatar of Geoff Sutton
Geoff Sutton
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial