Click here to Skip to main content
15,915,509 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi, I can upload images to my database table and store in it. But i cannot save the image in the folder.

here my .cs :

protected void AsyncFileUpload1_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
{
String filename = System.IO.Path.GetFileName(AsyncFileUpload1.FileName);
AsyncFileUpload1.SaveAs(Server.MapPath(this.UploadFolderPath) + filename);
}

my aspx :

Product Image<asp:AsyncFileUpload ID="AsyncFileUpload1"
runat="server" onuploadedcomplete="AsyncFileUpload1_UploadedComplete"/>
Posted
Comments
[no name] 30-Jun-13 13:28pm    
What does "i cannot save the image in the folder" even mean?
NooobieCoder 30-Jun-13 13:34pm    
I have a folder in project that named "Images" where by I wan to save the uploaded image into it. The problem is when the user click insert, it can be stored into my database table, but not as the folderpath

So in my database table under Image column, I wan to get this : ~/Image/prod.jpg instead of prod.jpg
[no name] 30-Jun-13 14:04pm    
Okay.... maybe you can use the Improve question widget to add an appropriate title to your question, ask a question, and post the code that is relevant to your question. As it is right now, your comment, the title of your question, the code and the narrative (that is not a question) have no relation to each other and there is nothing here that relates in any way to any database.

1 solution

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