Process.start not running in IIS

Posted by Oswaldlily under ASP.NET on 5/9/2013 | Points: 10 | Views : 1079 | Status : [Member] | Replies : 1
Process.start("physicalpath") not running in IIS..
I have used this for downloading excel from database..

I have stored file contents as bytes in database.
Is it possible to retrieve the contents in excel file.
File may have image or columns...




Responses

Posted by: Learningtorise on: 5/10/2013 [Member] Starter | Points: 25

Up
0
Down
Use following Code to download file at Client Browser(You can write this on a button's click also):

 Response.Clear();


Response.ClearHeaders();

Response.ClearContent();

Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);

Response.AddHeader("Content-Length", file.Length.ToString());

Response.ContentType = "application/vnd.ms-excel"; //mime-type for .xls extension

Response.Flush();

Response.TransmitFile(file.FullName);

Response.End();



For this you'll have to Store File as images in SQL table though...


http://hashtagakash.wordpress.com/

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response