Click to See Complete Forum and Search --> : How to upload a file from local computer to a remote server via ASP.NET?


Takhir
May 24th, 2006, 05:32 PM
The question is next:

I have a site that hosted on a remote server. I need the user to upload files from his own local computer to this server via .aspx page. There's a BROWSE control for selecting a file and UPLOAD button on this page.
The UPLOAD button should transmit the file from user's computer to a definite folder on my remote server. It should work like this:

...SaveAs("\\images\\file_name.jpg")

But in this case an error occured because application tries to save a file on a denied place of server.
Please help me in such question.

anisha20
May 25th, 2006, 01:46 AM
check this:

File1.PostedFile.SaveAs(Request.PhysicalApplicationPath+"/images/"+File1.PostedFile.Filename)

Takhir
May 25th, 2006, 02:28 AM
Ok, thank you, I'll check this in 2-3 hours and then reply to this post again...

Takhir
May 30th, 2006, 03:23 AM
All works well, thank you!