Connecting Tech Pros Worldwide Forums | Help | Site Map

save file to a url

Jeremy Chapman
Guest
 
Posts: n/a
#1: Nov 19 '05
Given a url, how can I programatically save a file to the location at the
specified url?
System.IO.File.Create does not work because it doesn't accept URL's. Assume
that I have the correct security rights to do this?



John Timney \(ASP.NET MVP\)
Guest
 
Posts: n/a
#2: Nov 19 '05

re: save file to a url


To a URL you would have to do an upload, and have a script at the remote
server that would accept file uploads. So, you have to simulate a form post
using the file IO objects, and something to accept a file. An easy approach
is to convert your file to a binary stream and send it to a webservice as
shown here.

http://www.dotnet247.com/247referenc...?TOPIC_ID=9426
or here
http://www.dotnet247.com/247referenc...9-fca12f7caa49

As you cant easily set the name of a posted file without user interaction
using input type = file its a quick solution.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Jeremy Chapman" <me@here.com> wrote in message
news:uZLEJ7EpFHA.3536@TK2MSFTNGP15.phx.gbl...[color=blue]
> Given a url, how can I programatically save a file to the location at the
> specified url?
> System.IO.File.Create does not work because it doesn't accept URL's.
> Assume that I have the correct security rights to do this?
>
>[/color]


Closed Thread