[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1012
  • Last Modified:

webClient.UploadFile Problems with uploading local file

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!

0
dmve
Asked:
dmve
  • 2
1 Solution
 
vb_jonasCommented:
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.
0
 
vb_jonasCommented:
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
0
 
dmveAuthor Commented:
Perfect, thanks. A bit hard to understand the usage I think...  But it works and thats the main thing :-)
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now