Posted on: 10/15/2013 2:17:38 PM | Views : 818

Hey guys, I'm trying to figure out how to change this code to instead of saving the file to the web server hard drive to store it in memory stream only. In this shared hosting environment, we are not allowed to write to the hard drive. Here's the code:
 
protected void UploadButton_Click(object sender, EventArgs e) { if (FileUploadControl.HasFile) { try { if (FileUploadControl.PostedFile.ContentType == "text/plain") { if (FileUploadControl.PostedFile.ContentLength < 10240000) { // Right in here is the problem - SaveAs string filename = Path.GetFileName(FileUploadControl.FileName); FileUploadControl.SaveAs(Server.MapPath("~/") + filename); StatusLabel.Text = "Upload status: Fil ...

Go to the complete details ...