Click here to Skip to main content
15,878,230 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends
I want to upload the path (from where I am taking the file to upload in project folder) of files into database.I wrote the following lines for this purpose in ASP.Net.

C#
string fileName = Path.GetFileName(blgFile.PostedFile.FileName);
           string filePath = blgFile.PostedFile.FileName;

I am inserting filePath in database.
If these lines reqiures some correction then please make me aware of.
Thanks in advance.

With Best Regards
Akhilesh Pathak
Posted
Comments
Agent__007 5-Mar-13 2:06am    
These lines seem to be ok, what is the issue ?
Azziet 5-Mar-13 2:10am    
what is the issue?
Akhilesh Kumar Pathak 5-Mar-13 2:11am    
I am taking files from E/Blogs/ folder which is in E drive so the path(E/Blogs/fileName)is not going into databse.But in database file name is inserting.
Nandakishore G N 5-Mar-13 2:19am    
what is the reason to save physical path in the database.Instead copy the file into a temp folder of your application.and save that path to the database.

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