Click here to Skip to main content
15,890,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i wrote the code for fileupload control such that when i click browse the path of the file is being stored instead of that i need to store the uploaded file in a floder under solution explorer and the name of the file should be stored in the database.can anyone help me.

clsAdminBLL.Saveresources(ddldocumenttype.SelectedItem.Text.ToString(), fudocs.PostedFile.ToString(),txttitle.Text.ToString(), Convert.ToDateTime(txtdate.Text.Trim()).ToString());
Posted
Comments
Abhishek Sur 26-Aug-10 15:18pm    
You are talking about ASP.NET file upload control. You must tag the question with ASP.NET to get people interested in ASP.NET to get your question quickly.

Google[^] is your friend and I bet there a number of articles on CP if you can be bothered to search for them.
 
Share this answer
 
I am astounded at how many alleged programmers keep calling ToString on string objects.

You're calling ToString on postedfile, is that not the file data ? you need to store the file data as a byte array, which is what it is. The filename is also available to you on the upload control.
 
Share this answer
 
Comments
srujanac# 26-Aug-10 6:43am    
iam sorry but i dint get what to do now what i need is to store the uploaded file in a folder and the name of it in the database.iam very new to it can u help
I hope this would help you.

File Upload with ASP.NET[^]
 
Share this answer
 

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