public void try1_Click(object sender, EventArgs args) { bool shouldRedirect = true; try1_Click_Base(sender, args); //searching the html control called inputFile System.Web.UI.HtmlControls.HtmlInputFile inputFile; inputFile = ((System.Web.UI.HtmlControls.HtmlInputFile)(this.Page.FindControl("inputFile"))); if ((!(inputFile.PostedFile == null) && (inputFile.PostedFile.ContentLength > 0))) { // getting the filename // getting the savelocation string fileName = System.IO.Path.GetFileName(inputFile.PostedFile.FileName); string saveLocation = (this.Page.Server.MapPath("..\\Data") + ("\\" + fileName)); try { // start transaction to store the file location to DB DbUtils.StartTransaction(); // saving file to file system inputFile.PostedFile.SaveAs(saveLocation); // setting the control value = saveLocation this.ImageRecordControl.url.Text = saveLocation; // saving data to DB this.ImageRecordControl.SaveData(); this.CommitTransaction(sender); } catch (Exception ex) { this.Page.Response.Write(("Error: " + ex.Message)); shouldRedirect = false; BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(this, "BUTTON_CLICK_MESSAGE", ex.Message); this.RollBackTransaction(sender); } finally { DbUtils.EndTransaction(); } if (shouldRedirect) { this.ShouldSaveControlsToSession = true; } } else { this.Page.Response.Write("Please select a file to upload."); } }
Wednesday, 3 February 2010
iron speed: upload a file to file system and save the location in database...solved
iron speed: upload a file to file system and save the location in database...[phase two] cont...
Tuesday, 2 February 2010
iron speed: upload a file to file system and save the location in database...[phase two]
iron speed: upload a file to file system and save the location in database...[phase one]
iron speed: upload a file to file system and save the location in database...
From a place miles away from my destination
The last time I have blogged is almost exactly three and half years ago. Although I have uploaded this blog with few of my researches every now and then, I haven’t been able to ‘blog’ in real sense if you know what I mean. If someone asks ‘What happened?’ I do not think that I have an appropriate answer for it. I have come across to many life changing events in these three years. Some have given me new prospective of life, and some were even worse than the horrific nightmares I see. Rest assured, I have left my dream of becoming youngest ever MSCRM and MSEPM professional miles away. I have started my life new as a rookie again. The blogs that I’ll post here after will be of the problems and issues that I come across to my day to day activities. It will not deal with EPM or CRM. Not anymore......