0

hello to all ,i want to attach a text file for downloading the website i am developing through asp.net.........
plz help me in the coding..........
i am sending the coding as below.........

on link button...
Response.AppendHeader("Content-Disposition",Attachment.FileName=TextFile1.txt);
Response.ContentType="Text";
Response.WriteFile("TextFile1.txt");

2
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by coolshail_87
0

Hi coolshail...
Try out with this

Response.Clear()
Response.AddHeader("content-disposition", "attachment;filename=Text1.txt")
Response.AppendHeader("Content-disposition", "attachment; filename=Text1.txt")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)

It working fine.....

0

@ rmahesh.............
those coding were working properly.but the problem is wen i click the link button the file poped up to get downloaded or opened is in HTML format and is of 8.01 kb........
is tat the problem of path..........
plz tell me how to gave path of the file to get downloaded.


thanks wid regards.....

0

@ rmahesh.............
those coding were working properly.but the problem is wen i click the link button the file poped up to get downloaded or opened is in HTML format and is of 8.01 kb........
is tat the problem of path..........
plz tell me how to gave path of the file to get downloaded.


thanks wid regards.......

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.