Hojoformo
asked on
File Upload & Read Problem - Could not find a part of the path
This should be a problem bug to find. I keep getting error message "Could not find a part of the path "C:\Inetpub\wwwroot\WebApp lication7\ 055070021F EB-04DET.c sv" when trying to read records. This is not the path I saved the file to on the server.
string sFileDir= "c:/hosting/webhost4life/m ember/vcn7 70/ASPX/";
string sFileName = System.IO.Path.GetFileName (filUpload .PostedFil e.FileName );
filUpload.PostedFile.SaveA s(sFileDir + sFileName);
StreamReader reader = new StreamReader(filUpload.Pos tedFile.Fi leName); ???? is there something wrong with this code?????
readcontents = reader.ReadLine();
string sFileDir= "c:/hosting/webhost4life/m
string sFileName = System.IO.Path.GetFileName
filUpload.PostedFile.SaveA
StreamReader reader = new StreamReader(filUpload.Pos
readcontents = reader.ReadLine();
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hello,
It seems u want to read the saved file itself....Pls try this
filUpload.PostedFile.SaveA s(sFileDir + sFileName);
StreamReader reader = new StreamReader(sFileDir + sFileName);
It seems u want to read the saved file itself....Pls try this
filUpload.PostedFile.SaveA
StreamReader reader = new StreamReader(sFileDir + sFileName);
Not sure - but worth a try...
Can you change this path lto have back slashes and try - )
cheers
Can you change this path lto have back slashes and try - )
cheers
string root = Server.MapPath("virtual folder");
Bob