PDA

View Full Version : File Upload Error


rrvolk17306
11-27-2004, 01:46 AM
When I try to upload a file I get the following error:

System.IO.DirectoryNotFoundException: Could not find a part of the path "c:\htdocs\glc\gadmin\upl\auhtors1.txt". at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at System.Web.HttpPostedFile.SaveAs(String filename) at glc.newsletter_upload.Button1_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\glc\gadmin\newsletter_upload.as px.vb:line 74





What is the valid upload path to use for my site?





Dim m_strFolderName As String = "\htdocs\glc\gadmin\upl\"


...


m_objFile.SaveAs(m_strFolderName & m_strFileName)

Eric
11-27-2004, 03:00 AM
You can find the full server path to your account in the Account Information section of your control panel.

DiscountASP.NET
http://www.DiscountASP.NET

bruce
11-29-2004, 07:45 AM
Try this

Dim m_strFolderName As String = server.mappath('\glc\gadmin\upl')

Bruce

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)