views:

220

answers:

0

Question about c# ASP.Net server side code:

  • Using c# ASP.Net 3.5 for on the fly created file
  • ContentType = "application/save"
  • File extension is exe

I want the browser to open the save/run .

I'm doing a resumed download using

string contentRange = string.Format("bytes {0}-{1}/{2}", lastRange, fullSize - 1, fullSize);
Response.AddHeader(HttpResponseHeader.ContentRange.ToString(), contentRange);

Response.AddHeader(HttpResponseHeader.AcceptRanges.ToString(), "bytes");

Any alternative to Content-Disposition for setting the filename to be sent to download?

All posts say not to use it. Its not supported by http1.1 and has many drawbacks. I'm looking for something in the HttpResponseHeader or HttpRequestWorker members.

Thanks, Moshe