We help IT Professionals succeed at work.

webClient.UploadFile Problems with uploading local file

dmve
dmve asked
on
This line.... :  
webClient.UploadFile("ftp://myserver.com/" + "test.txt", "c:\test.txt")
....works fine when the app is running on my local PC. The file "test.txt" sits on the c-drive on my local PC and all is fine...   BUT when moving the app to the server, and access the page through internet, the same line looks for test.txt on the local c-drive of the server...

I need to load the file from the webclient... And this is what I thought it did, until I moved it to the server....  

Please Help!

Comment
Watch Question

Commented:
Hi!

The page must be able to access the local file someway, if you run it on the server, use the FileUpload control on a asp.net-page.
Commented:
Here's an article describing FileUpload. If you need the path on the server, use Server.Mappath("/myuploadfolder").

http://www.wrox.com/WileyCDA/Section/id-292158.html

Author

Commented:
Perfect, thanks. A bit hard to understand the usage I think...  But it works and thats the main thing :-)

Explore More ContentExplore courses, solutions, and other research materials related to this topic.