jamesdean666
asked on
Virtual Path Error in ASP.NET
I am trying ftp files that I upload to my web server that my website is hosted on. I can successfully upload the files to a directory on the C:\ drive, but when I try to ftp them and point to them in my code, I am getting the error stating 'C:\...' is not a valid virtual path.
My site is hosted in IIS, so the web files are stored in that location. I am trying to point to a location that is not in the same root directory.
I've tried ..//, ~/, and several other techniques, but I can't get it to work.
Any Ideas?
My site is hosted in IIS, so the web files are stored in that location. I am trying to point to a location that is not in the same root directory.
I've tried ..//, ~/, and several other techniques, but I can't get it to work.
Any Ideas?
Use Server.MapPath
Do it something like
Dim FILENAME As String = "C:\websites\" + TextBox1.Text + ".txt"
Dim FILENAME As String = "C:\websites\" + TextBox1.Text + ".txt"
Oops, I left the server.mappath. Sorry!
Dim FILENAME As String = Server.MapPath("C:\website s\" + TextBox1.Text + ".txt")
Dim FILENAME As String = Server.MapPath("C:\website
Oh, Correction from my previous post use relative addressing rather than the one I provided.
Check this out:
http://msdn.microsoft.com/en-us/library/ms524632%28VS.90%29.aspx
Check this out:
http://msdn.microsoft.com/en-us/library/ms524632%28VS.90%29.aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yahtzee.... Thanks...