Click here to Skip to main content
15,919,434 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Regular expression needed Pin
just3ala24-Dec-06 20:04
just3ala24-Dec-06 20:04 
GeneralRe: Regular expression needed Pin
ednrgc5-Dec-06 6:46
ednrgc5-Dec-06 6:46 
QuestionDatagrid Problem Pin
monika_vasvani4-Dec-06 19:50
monika_vasvani4-Dec-06 19:50 
AnswerRe: Datagrid Problem Pin
M LN Rao4-Dec-06 23:02
M LN Rao4-Dec-06 23:02 
QuestionThe memory could not be written. Pin
MissionSuccess4-Dec-06 19:04
MissionSuccess4-Dec-06 19:04 
QuestionCustom Web component Pin
Kanjinghat4-Dec-06 19:02
Kanjinghat4-Dec-06 19:02 
AnswerRe: Custom Web component Pin
M LN Rao4-Dec-06 22:52
M LN Rao4-Dec-06 22:52 
QuestionUpload and download .txt file Pin
Nagraj Naik4-Dec-06 18:30
Nagraj Naik4-Dec-06 18:30 
Hi friends,

I want to upload and download .txt file in my web application.
Uploading part is completed successfully but when I am download the same file and reopen it,it contain complete html code of current page why this is so.
In case of .doc file this problem not occured.

Code snap is given below.

Public Sub Download(ByVal _fileName As String)
Try
Dim root As String = Server.MapPath("..\Operations\files\")
Dim sb As New StringBuilder(2048)
Dim f As String
Dim filename As String = _fileName

Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Disposition", _
"attachment; filename=""" & filename & """")
Response.Flush()
Response.WriteFile(root + (Server.UrlEncode(filename)))

Catch ex As Exception
End Try
End Sub

I hope somebody help me.

Regards,
Nagraj



-- modified at 1:05 Tuesday 5th December, 2006
AnswerRe: Upload and download .txt file Pin
Kapil Thakur4-Dec-06 18:41
Kapil Thakur4-Dec-06 18:41 
GeneralRe: Upload and download .txt file Pin
Nagraj Naik4-Dec-06 19:03
Nagraj Naik4-Dec-06 19:03 
AnswerRe: Upload and download .txt file(Ultimate solution) Pin
Nagraj Naik4-Dec-06 20:01
Nagraj Naik4-Dec-06 20:01 
QuestionUsing Text Box of another page Pin
Khan.Bangash4-Dec-06 18:12
Khan.Bangash4-Dec-06 18:12 
GeneralRe: Using Text Box of another page Pin
Guffa4-Dec-06 18:31
Guffa4-Dec-06 18:31 
GeneralRe: Using Text Box of another page Pin
Khan.Bangash4-Dec-06 18:49
Khan.Bangash4-Dec-06 18:49 
AnswerRe: Using Text Box of another page Pin
Guffa4-Dec-06 20:42
Guffa4-Dec-06 20:42 
AnswerRe: Using Text Box of another page Pin
Kapil Thakur4-Dec-06 18:48
Kapil Thakur4-Dec-06 18:48 
GeneralRe: Using Text Box of another page Pin
Khan.Bangash4-Dec-06 18:53
Khan.Bangash4-Dec-06 18:53 
QuestionRetrieving a connection string Pin
mohd imran abdul aziz4-Dec-06 18:10
mohd imran abdul aziz4-Dec-06 18:10 
GeneralRe: Retrieving a connection string Pin
Guffa4-Dec-06 18:32
Guffa4-Dec-06 18:32 
AnswerRe: Retrieving a connection string Pin
Khan.Bangash4-Dec-06 19:13
Khan.Bangash4-Dec-06 19:13 
GeneralRe: Retrieving a connection string [modified] Pin
mohd imran abdul aziz4-Dec-06 19:19
mohd imran abdul aziz4-Dec-06 19:19 
GeneralRe: Retrieving a connection string Pin
Khan.Bangash4-Dec-06 20:02
Khan.Bangash4-Dec-06 20:02 
QuestionJavascript Parameters Pin
monika_vasvani4-Dec-06 18:02
monika_vasvani4-Dec-06 18:02 
AnswerRe: Javascript Parameters Pin
Guffa4-Dec-06 18:52
Guffa4-Dec-06 18:52 
AnswerRe: Javascript Parameters Pin
Kapil Thakur4-Dec-06 18:53
Kapil Thakur4-Dec-06 18:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.