Hi Jim,
Looking at your code here my 5 cents :
your code : filename = txtUpload.PostedFile.FileName.Trim(); will return
the full filename
e.g c:\test\fileUploads\filetoupload.txt
hence file name = c:\test\fileUploads\filetoupload.txt
now when you do
txtUpload.PostedFile.SaveAs(@"C:\home\sites\bobo.c om\web\" + filename)
you are doing (@"C:\home\sites\bobo.com\web\" +
"c:\test\fileUploads\filetoupload.txt")
hence it will try to save the file in the path :
C:\home\sites\bobo.com\web\c:\test\fileUploads\fil etoupload.txt
which is invalid format coz of c:\ being twice and hence you getting the
invalid format error
********************************
Hope this helps,
S.H.A.U.N â„¢ (M.C.P)
Shounak P
http://blogs.wwwcoder.com/shaunakp
*********************************
"Jim McGivney" wrote:
In an aspx page I run the following C# code-behind:
string filename = null;
filename = txtUpload.PostedFile.FileName.Trim();
//save the file
txtUpload.PostedFile.SaveAs(@"C:\home\sites\bobo.c om\web\" + filename);
I get the following error: The given path's format is not supported.
Any suggestions as to the proper format for the path would be appreciated.
Thanks,
Jim