save file to a url

  • Thread starter Thread starter Jeremy Chapman
  • Start date Start date
J

Jeremy Chapman

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?
 
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/247reference/a.aspx?u=http://p2p.wrox.com/topic.asp?TOPIC_ID=9426
or here
http://www.dotnet247.com/247referen...spx?guid=6c2a8fab-1310-4cd5-9cc9-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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top