Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Uploading a file.

Status
Not open for further replies.

ofsouto

Programmer
Joined
Apr 29, 2000
Messages
185
Location
BR
Hi, dear

I'm trying to process (read and load database) a client side file (C:\Test Files\17 classes\clients.txt) but an error message shows up: “Could not find a part of the path "C:Test Files?classesclients.txt"”
I'm using HtmlInputFile to search file on client side and I get the file name with HtmlInputFilePostedFile.FileName

Is there any way to solve this problem?

Thank you very much.

Obede
 
Somewhere, you're apparently stripping out the '\' characters? '\17' must be '?'.

I'd start by commenting out the stuff that references PostedFile.FileName and inserting this line of code as an experiment:

Code:
HtmlInputFile.PostedFile.SaveAs("c:\test.txt");
 
try doubling all '\' 's, so :

"C:\\Test Files\\17 classes\\clients.txt"

the "\" is not a normal character, its a special character in a string. In C# you could also put "@" before a string so that there are no special characters in it.

Look for strings and C# on the internet.

check this

--------------------------------------
deleau@gmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top