Click here to Skip to main content
15,912,400 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: DataGrid Pin
kumarjammula18-May-07 17:44
kumarjammula18-May-07 17:44 
GeneralRe: DataGrid Pin
enjoycrack18-May-07 17:47
enjoycrack18-May-07 17:47 
AnswerRe: DataGrid Pin
Sathesh Sakthivel18-May-07 17:59
Sathesh Sakthivel18-May-07 17:59 
QuestionHelp me how to upload files to server using ASP.NET Pin
Hanh Aeriscute18-May-07 16:52
Hanh Aeriscute18-May-07 16:52 
QuestionRe: [Same Query] Help me how to upload files to server using ASP.NET [modified] Pin
nareshss18-May-07 17:48
nareshss18-May-07 17:48 
QuestionGetting a Photo into a radiobuttonlist Pin
Mxrider8418-May-07 14:14
Mxrider8418-May-07 14:14 
AnswerRe: Getting a Photo into a radiobuttonlist Pin
Mxrider8418-May-07 14:44
Mxrider8418-May-07 14:44 
Questionserving a file as a response to a HTML GET Request [modified] Pin
Glen Harvy18-May-07 13:56
Glen Harvy18-May-07 13:56 
Hi,

I am new to asp.net although not to c# and I need to put together an aspx page that receives data sent to it via a web form using GET.

I can get the sent data OK but I need to use that data to generate a binary file. I can do that OK as well.

The problem I have is I need to serve that generated file back to the requesting server automajically Confused | :confused:

Can some one explain how I can do that and if possible provide example code OR better still, point me to a tutorial that covers this without over complicating the issue.

Thanks,


-- modified at 21:57 Friday 18th May, 2007

I think I'm getting there Smile | :) The following code partially solves my problem EXCEPT there are two issues - (1) The file being sent includes the text in the aspx page as well as the text in the file and (2) I need to get rid of the prompt to download the file. Here's the code:
<br />
    private void SendKeyFile()<br />
    {<br />
      string root = "C:\\temp\\";<br />
      string filepath = root + "debug.txt";<br />
      if (!(filepath == null))<br />
      {<br />
        if (File.Exists(filepath) && filepath.StartsWith(root))<br />
        {<br />
          string filename = Path.GetFileName(filepath);<br />
          Response.Clear();<br />
          Response.ContentType = "application/octet-stream";<br />
          Response.AddHeader("Content-Disposition", ("attachment; filename=\"" + (filename + "\"")));<br />
          Response.Flush();<br />
          Response.WriteFile(filepath);<br />
        }<br />
      }<br />
    }<br />


Am I on the right track here?

Glen Harvy

AnswerRe: serving a file as a response to a HTML GET Request Pin
kubben19-May-07 2:30
kubben19-May-07 2:30 
GeneralRe: serving a file as a response to a HTML GET Request Pin
Glen Harvy19-May-07 2:55
Glen Harvy19-May-07 2:55 
Questionregarding forum!!!!!!!!!!!!!!!!!!! Pin
s_a_20026318-May-07 10:54
s_a_20026318-May-07 10:54 
AnswerRe: regarding forum!!!!!!!!!!!!!!!!!!! Pin
Christian Graus18-May-07 14:01
protectorChristian Graus18-May-07 14:01 
GeneralRe: regarding forum!!!!!!!!!!!!!!!!!!! Pin
s_a_20026318-May-07 14:35
s_a_20026318-May-07 14:35 
GeneralRe: regarding forum!!!!!!!!!!!!!!!!!!! Pin
Christian Graus18-May-07 15:22
protectorChristian Graus18-May-07 15:22 
AnswerRe: regarding forum!!!!!!!!!!!!!!!!!!! Pin
enjoycrack18-May-07 17:36
enjoycrack18-May-07 17:36 
QuestionPDF Component Pin
adnanrafiq18-May-07 8:58
adnanrafiq18-May-07 8:58 
QuestionASP.Net Application Deployment Pin
adnanrafiq18-May-07 8:55
adnanrafiq18-May-07 8:55 
AnswerRe: ASP.Net Application Deployment Pin
enjoycrack18-May-07 17:34
enjoycrack18-May-07 17:34 
Questionabout dll files Pin
s_a_20026318-May-07 7:52
s_a_20026318-May-07 7:52 
AnswerRe: about dll files Pin
Colin Angus Mackay18-May-07 8:27
Colin Angus Mackay18-May-07 8:27 
GeneralRe: about dll files Pin
s_a_20026318-May-07 9:02
s_a_20026318-May-07 9:02 
AnswerRe: about dll files Pin
Christian Graus18-May-07 14:04
protectorChristian Graus18-May-07 14:04 
QuestionAJAX avoid using Reponse.write Pin
cisco210318-May-07 5:21
cisco210318-May-07 5:21 
AnswerRe: AJAX avoid using Reponse.write Pin
Not Active18-May-07 5:27
mentorNot Active18-May-07 5:27 
GeneralRe: AJAX avoid using Reponse.write Pin
cisco210318-May-07 5:30
cisco210318-May-07 5:30 

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.