Monday, February 8, 2010

Is there any way to upload files in asp.net without using html file input control?

I created a html file input control for uploading files to a web server and it worked well. When the asp.net application on the web server was moved from C: to D: dir, Iam getting an error, ';Could not find a part of the path C://inetpub//wwwroot//';. This error occurs even when the file is loaded from any location other than C: dir on the client system. But file is uploaded when I do it fromthe localhost. The problem is while loading on the server only. Why is it so?Is there any way to upload files in asp.net without using html file input control?
That's because you hard coded the direct path of the folder ie





C://inetpub//wwwroot//





This is not very flexible, because you will have problems if things get moved around, which happened to you.





Instead, specify a relative path like ';/inetpub/wwwroot/';





This will automatically search the respective drive for the folder /inetpub/wwwroot/';.
  • top myspace
  • No comments:

    Post a Comment