By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,578 Members | 828 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,578 IT Pros & Developers. It's quick & easy.

upload file to a non IIS site using asp.net

P: n/a
Hi, I've been trying to find a way to upload file to another site that
is not using IIS. The site that I want to upload file to has a simple
php script to receive file uploaded through standard http post with a
file upload. However, how do I upload file to the site using asp.net?
thanks
Brian
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Brian wrote:
Hi, I've been trying to find a way to upload file to another site that
is not using IIS. The site that I want to upload file to has a simple
php script to receive file uploaded through standard http post with a
file upload. However, how do I upload file to the site using asp.net?


Do you want to include a file upload option in a web form or do you
want to upload the file in your server-side code?

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #2

P: n/a
I need both. In the Web form user can upload a file to another Apache
server that has a php script to received the uploaded file or they can
upload the file to my site and my IIS server will do some server side
process and then upload the processed file to an Apache server.

thanks
Brian

Nov 19 '05 #3

P: n/a
Hi Brian,

You might want to investigate the Webclient class for that. It allows you to
simulate - in code - all the aspects of a POST, including uploading a file:

http://msdn.microsoft.com/library/de...dfiletopic.asp

' Create a new WebClient instance.
Dim myWebClient As New WebClient()
Console.WriteLine(ControlChars.Cr + "Please enter the fully qualified path
of the file to be uploaded to the URL")

Dim fileName As String = Console.ReadLine()
Console.WriteLine("Uploading {0} to {1} ...", fileName, uriString)

' Upload the file to the Url using the HTTP 1.0 POST.
Dim responseArray As Byte() = myWebClient.UploadFile(uriString, "POST",
fileName)

Ken

"Brian" <br********@hotmail.com> wrote in message
news:29**************************@posting.google.c om...
Hi, I've been trying to find a way to upload file to another site that
is not using IIS. The site that I want to upload file to has a simple
php script to receive file uploaded through standard http post with a
file upload. However, how do I upload file to the site using asp.net?
thanks
Brian


Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.