Questions tagged [content-disposition]

The Content-Disposition response header field is used in HTTP web responses to convey additional information about how to process a response payload. It can also be used to attach additional metadata such as a filename to the response.

The Content-Disposition response header field is used in HTTP web responses to convey additional information about how to process a response payload. It can also be used to attach additional metadata such as a filename to the response. The full definition of the content-disposition header is outlined in RFC 6266.

The content-disposition header is added to a HTTP response when further descriptive information is desired to aid the receiver in interpreting the payload. Usage follows the following grammar:

content-disposition = "Content-Disposition" ":" disposition-type *( ";" disposition-parm )

disposition-type = "inline" | "attachment" | disp-ext-type ; case-insensitive disp-ext-type = token

disposition-parm = filename-parm | disp-ext-parm

filename-parm = "filename" "=" value | "filename*" "=" ext-value

disp-ext-parm = token "=" value | ext-token "=" ext-value ext-token =

Questions related to this tag should be concerned with describing the payload of a HTTP Response. An example question may be - "Save a PDF that's been streamed to the browser"

448 questions
0
votes
1 answer

save as dialog box to save a PDF file

I am trying to display a save as dialog box to save a PDF file. This should happen on click of a link in the JSP. On click of this link I call a struts action which prepares PDF and forwards to another JSP 'download.jsp' which I want to use for the…
Kalo
  • 1
  • 2
0
votes
1 answer

Multiple sequential async web service calls from an asynchronous ASP.NET page?

I need to make n number of async web service calls from an async ASPX page. Each WS call retrieves a portion of a binary file. The code then outputs the file block to the page's response stream. offset = 0; blocksize = 1024; output =…
frankadelic
  • 20,543
  • 37
  • 111
  • 164
0
votes
2 answers

How to read GZip content sent in a http response

I have been trying for over a week now to be able to read the gzipped content sent in an Http Respose. OK, let me be more specific - the web server sends a response which has the Content-Disposition header and the attachment attribute, like…
JaySO
  • 1
  • 3
0
votes
1 answer

ASP.NET MVC: Display pdf in browser. Works in chrome, not ie or firefox

I'm running VS 2012 in Windows 8 (on a virtualbox hosted in mac os x). MVC 3 in C#. When the user selects a Document, it should open in a new browser window. Currently: Chrome (v24.0.1312.56 m) - opens in new window, as desired Firefox (v18.0.1) -…
kozmi
  • 25
  • 2
  • 8
0
votes
1 answer

Why is there always an additional extension .sdx appended to my file?

I've got a strange problem here: in an ASP.NET controller I do that: public ActionResult ExportTex() { Response.ContentType = "text/plain"; Response.AddHeader("Content-Disposition", "attachment;filename=\"" +…
Hendrik Wiese
  • 2,010
  • 3
  • 22
  • 49
0
votes
0 answers

Get contents of a file served with Content-Disposition in PHP

I'm trying to get the contents of a remote file using cURL or file_get_contents, but since the file is served using Content-Disposition, it seems that I only get the source of the webpage instead of the iCal file I actually want. The URL I want to…
Arno Moonen
  • 1,134
  • 2
  • 10
  • 28
0
votes
2 answers

Error in downloading word document in php

I have a word document which I want the users to download from a link on site . The code works fine on my localhost . However , when I upload the website on the server , instead of giving the option to save on the local machine , it opens up in the…
saurabh
  • 1,730
  • 2
  • 15
  • 13
0
votes
2 answers

POST more information from HTML page (more than input values)

I am starting web developement. While POSTing a form, all the input fields are sent as properties (Content-Disposition). I would like to add more information (I mean more properties sent by POST), like a value of some html tag, or the value of an…
minchiya
  • 603
  • 1
  • 7
  • 13
0
votes
1 answer

PHP Force download not working

Here is my problem. I am trying to download a file using header. Here is my code: $content_type = mime_content_type('uploads/MyBBIntegrator_v1.3.1.zip'); $file = 'uploads/MyBBIntegrator_v1.3.1.zip'; header("Cache-Control:…
0
votes
1 answer

asp.net download excel file in IE6

I have been trying to have the user download an excel file via a download prompt. Everything works fine in firefox and IE7 + but it doesnt work in IE6. In IE6, it displays the name of the aspx page and downloads a blank page. Here is my…
0
votes
2 answers

Download and/or View .pdf on the same page

I am using IIS/asp.net and have a requirement to have two links side by side on the same page. They both link to the same exact file, but with two different behaviors, one should view the file and the other should download the file.
hardba11
  • 1,478
  • 15
  • 27
0
votes
1 answer

download data error when using ASIHTTPRequest to set the download destination file path in requestDidReceiveResponseHeadersSelector: method

i use ASIHTTPRequest to download file to ios device when i set the download destination file path right after the request has been created, it works well, where my code is: A SIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request…
Roen
  • 116
  • 6
0
votes
1 answer

how to force sevlet to send a String as attachment to browser?

I want to send a String to user Actually I don't have any file for it. It is only a standard java string and I want user to download it rather than see it on browser. Most of the example on internet are based on a static file which is not useful for…
Vahid Hashemi
  • 5,182
  • 10
  • 58
  • 88
0
votes
4 answers

How to access servlet and download attachment?

I have the following code snippet that tries to make an HTTP call to my servlet: try { // Construct data String data = URLEncoder.encode("rpt_type", "UTF-8") + "=" + URLEncoder.encode(reportType, "UTF-8"); data += "&" +…
ohseekay
  • 795
  • 3
  • 20
  • 37
0
votes
1 answer

Saving a data:url of a PNG image locally using Google App Engine

I am using Google App Engine (python) and have a data: url of a PNG image available on the server. The PNG image was never in a file, as it was generated from some canvas code using toDataUrl() and ajaxed to the server. I would like to allow the…
1 2 3
29
30