File Uploading , Save and Retrieve in ASP.NETBineesh Viswanath13yAsked Aug 28, 2013, 9:28 PM EDT5 answersShareLinkedInXCopy linkSaveSir, I am in a program of FileUpload Control in ASP.NETIn this, i tried a bit to Upload and save image to database. I am getting an error. I can't get navigated to the error line during the double click.Help me in this topic
File Uploading , Save and Retrieve in ASP.NETBineesh Viswanath13yAsked Aug 28, 2013, 9:28 PM EDT5 answersShareLinkedInXCopy linkSaveSir, I am in a program of FileUpload Control in ASP.NETIn this, i tried a bit to Upload and save image to database. I am getting an error. I can't get navigated to the error line during the double click.Help me in this topic
Sanjeeb LenkaRank #301 · 8.3K reputation13y agoPosted Aug 28, 2013, 9:31 PM EDT0hi,plz share your code.0
Bineesh ViswanathRank #1,681 · 907 reputation13y agoPosted Aug 28, 2013, 10:33 PM EDT0could you mention which of the code part you need?0
Sanjeeb LenkaRank #301 · 8.3K reputation13y agoPosted Aug 28, 2013, 10:35 PM EDT0aspx and cs.then i will check from where the error is coming.0
Bineesh ViswanathRank #1,681 · 907 reputation13y agoPosted Aug 29, 2013, 1:53 AM EDT0Sir I am getting error from 2 section1) the parameter @photo is not supplied2)And the Path I given is:-Please check these code and reply.1)html code:- Data List BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical" RepeatDirection="Horizontal" Width="16px" > ImageUrl='<%# "~//Photo//Temp//"+Eval("Photo") %>' Width="219px" /> style="display:none;" /> onchange="detectfile()" />     Width="141px"> Text="Back" onclick="btnBack_Click" Width="88px" /> Text="Next" onclick="btnNext_Click" Width="81px" /> 2) .cs code:-public partial class DataList : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Application["PageIndex"] = 0; DataListFill(); } } public void ViewImage() { if (Fup.HasFile) { string fileName = Path.GetFileName(Fup.PostedFile.FileName); string strExtension = Path.GetExtension(Fup.FileName.ToLower()); if (strExtension == ".jpeg" || strExtension == ".jpg") { string photoName = "PhotoName" + DateTime.Now.Ticks + fileName; Fup.SaveAs(Server.MapPath("~\\Photos\\tempo\\" + photoName)); ViewState["photo"] = fileName; } } } public void DataListFill() { PhotoSP spPhoto = new PhotoSP(); DataTable d = spPhoto.PhotoViewAll(int.Parse(Application["PageIndex"].ToString())); DataList1.DataSource = d; DataList1.DataBind(); } protected void btnSave_Click(object sender, EventArgs e) { PhotoInfo infoPhoto = new PhotoInfo(); PhotoSP spPhoto = new PhotoSP(); infoPhoto.photoName = txtphotoName.Text; if (ViewState["photo"] != null) { infoPhoto.photo = ViewState["photo"].ToString(); } spPhoto.PhotoAdd(infoPhoto); } protected void DataList1_SelectedIndexChanged(object sender, EventArgs e) { } protected void btnUpload_Click(object sender, EventArgs e) { ViewImage(); } protected void btnBack_Click(object sender, EventArgs e) { if (int.Parse(Application["PageIndex"].ToString()) > 0) { Application["PageIndex"] = int.Parse(Application["PageIndex"].ToString()) - 1; DataListFill(); } } protected void btnNext_Click(object sender, EventArgs e) { PhotoInfo info = new PhotoInfo(); PhotoSP spPhoto = new PhotoSP(); if (int.Parse(Application["PageIndex"].ToString()) + 1 < spPhoto.PhotoCount()) { Application["PageIndex"] = int.Parse(Application["PageIndex"].ToString()) + 1; DataListFill(); } }0Sanjeeb LenkaRank #301 · 8.3K reputation13y agoPosted Aug 29, 2013, 2:02 AM EDT0hi,check this line.Fup.SaveAs(Server.MapPath("~/Photos//" + photoName));in aspx datalist: ImageUrl='<%# "~/Photos/"+Eval("Photo") %>' Width="219px" />0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign inKnow the answer?Answer a question in the forums and earn +20 SHARP for every answer.See unanswered questionsForumsTop experts01Arun PottiAnswers in the forums20answers02Tahir AnsariAnswers in the forums5answers03Kamlesh KumarAnswers in the forums5answers04Sam HobbsAnswers in the forums4answers05Željko PerićAnswers in the forums3answers?YouYour name goes here.Every answer: 20 SHARP.JoinFull leaderboard →2026DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sanjeeb LenkaRank #301 · 8.3K reputation13y agoPosted Aug 29, 2013, 2:02 AM EDT0hi,check this line.Fup.SaveAs(Server.MapPath("~/Photos//" + photoName));in aspx datalist: ImageUrl='<%# "~/Photos/"+Eval("Photo") %>' Width="219px" />0
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 28, 2013, 9:31 PM EDT
plz share your code.
Bineesh ViswanathRank #1,681 · 907 reputationPosted Aug 28, 2013, 10:33 PM EDT
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 28, 2013, 10:35 PM EDT
Bineesh ViswanathRank #1,681 · 907 reputationPosted Aug 29, 2013, 1:53 AM EDT
1) the parameter @photo is not supplied
2)
And the Path I given is:-
Please check these code and reply.
1)html code:-
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 29, 2013, 2:02 AM EDT
check this line.
Fup.SaveAs(Server.MapPath("~/Photos//" + photoName));
in aspx datalist:
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts