Click here to Skip to main content
15,908,675 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Pls some one tell that how to remove foldername from downloading a file. when i saved all type of file to database and in folder,~/UploadedText/123.txt and when i download the file as a user there is name of file changed like loadedText_123.txt.

but i want to display file to user as a 123.txt file only.

Can someone help to remove this error.
Posted

1 solution

I do not quite understand. But you can use Path class[^] to do all sorts of path and file operations.

If you just wants to get rid of "loadedText_", then just do a
C#
string filename = "loadedText_123.txt";
filename = filename.Replace("loadedText", string.Empty);
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 3-Jun-11 21:21pm    
That is correct, my 5. Whatever OP thinks :-), "but i want to display file to user as a 123.txt file only" does not mean anything else.
--SA
Kim Togo 4-Jun-11 1:39am    
Thanks SA. The only thing I do not understand. Is the file name "loadedText_123.txt" and then OP just wants do change it to "123.txt" ?
Sergey Alexandrovich Kryukov 5-Jun-11 23:05pm    
OP does not really understand it himself. :-)
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900