C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Download


Posted Date: 04 Nov 2009      Posted By: kavithathiayagarajan      Member Level: Silver     Points: 1   Responses: 2



I want to download files in my application. Coding works fine in IE7.0, firefox etc... But in IE6.0 it shows message like

"HTTP/1.1 200 OK Date: Tue, 03 Nov 2009 09:39:22 GMT Server: Microsoft-IIS/6.0 X-Powered-By:ASP.NET XASP.NET-Version:2.0.50727 Content-Disposition:attachment;FileName=org.html Content-Length:25088 Cache-Control:private Content-Type:application/*; charSet-ut-8“


I can’t understand this error. Can any one help me?

My code:
int SelIdx = e.Item.ItemIndex;
string filepath = dtFiles.Rows[SelIdx]["FilePath"].ToString();
FileInfo file = new FileInfo(filepath);
if (file.Exists)
{

Response.ClearContent();

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

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

Response.ContentType = "application/*";
Response.TransmitFile(file.FullName);
}





Responses

Author: Nikhil Gaur    04 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

look at this link

http://niksgaur.blogspot.com/2009/07/download-files-in-c.html

Join this campus group
http://www.dotnetspider.com/sites/637/-ecb-aspdotnet.aspx

Thanks & Regards
NIks
My Software and Web Development Experience



Author: Manindra Upadhyay    04 Nov 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Use this code
Response.ClearContent();

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

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

Response.ContentType = "application/*";
Response.Write(file.FullName);
Response.End();



Post Reply
You must Sign In to post a response.
Next : Data type mismatch in criteria expression.
Previous : Undefined function convert in expression
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use