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

The process cannot access the file XXX because it is being used by another process in asp.net web api

I have developed ASP.NET web API. I am trying to read content of an excel file and trying to return it as bytes. I am getting following error: The process cannot access the file 'C:\app\MyHost.AppServices\bin\Debug\temp\888.xlsx' because it is being…
SharpCoder
  • 18,279
  • 43
  • 153
  • 249
0
votes
1 answer

Close a popup browser window only if the user saves the downloaded file

We have a popup window where the user makes some selections and clicks on a button to generate a pdf file. We show a progress display (animated gif), and then eventually send the pdf contents to the user with content-disposition: inline. The user…
Bernard Chen
  • 6,437
  • 5
  • 23
  • 27
0
votes
1 answer

Document generation, force download, and refresh page

I'm not sure how to do it all the best way (just PHP, PHP + javascript...): I must allow the user to send some form data which generates a report file that becomes listed together with others previously generated, each one with a link to download…
Luis Martin
  • 910
  • 3
  • 14
  • 31
0
votes
2 answers

use of HTTP Content-Disposition

I have this code: resp.addHeader("Content-Disposition", "inline; filename=" + fileName); When the file name is a_b_c.doc or abc.doc the name of the downloaded file is displayed correctly. However, when the file name is a b c .doc the name of the…
Huy Than
  • 1,538
  • 2
  • 16
  • 31
0
votes
2 answers

How to use java to download a file preserving metadata?

What's the simplest java way to download a file over HTTPS, preserving timestamps and using the content-disposition for the filename? Is there any java library at a higher level than apache-httpclient? Currently I've got: HttpClient httpClient…
Jayen
  • 5,653
  • 2
  • 44
  • 65
0
votes
0 answers

how to force download with browsers native downloader and deny 3rd party internet download manager tools

We know that "Content-Disposition" http header will force client to download manually. But if any 3rd party download manager such as IDM was installed on the client it intercepts the web requests and disallows some cookies. Can I block these tools…
Onur Gazioğlu
  • 501
  • 2
  • 12
0
votes
1 answer

ASP.NET issue wih IE10 opening files stored in sql server DB

I have a little asp.net application which allows users to upload attachments, and via an asp:linkbutton download them from another screen. in IE10, when I click on the linkbutton to download the uploaded file, IR shows the open, save, cancel dialog…
0
votes
1 answer

"Save As" popup in response to a POST request?

Is it possible to get the browser to popup its Save As... dialog when doing a POST (rather than GET) request? Using the Spring framework, I'm trying to build a service that will receive some data (a two-dimensional json array), and produce an Excel…
some one
  • 77
  • 5
0
votes
2 answers

Downloading pictures/Word documents using ASP.NET

If I put the following code: Response.ContentType = "image/jpeg" Response.AppendHeader("Content-Disposition", "attachment; filename=capitol.jpg") Response.WriteFile(MapPath("capitol.jpg")) into Page_Load, I will get the dialog box to…
Miamian
  • 217
  • 6
  • 12
0
votes
2 answers

Workaround for file names with non-ascii characters on Android Chrome browser?

I've posted a similar topic on this issue, but that was more for discovery than comprehensive solution. I've discovered without a doubt that the Android Chrome browser is unable to handle UTF-8 encoding in the file name in the CONTENT-DISPOSITION…
TheDude
  • 1,421
  • 4
  • 29
  • 54
0
votes
2 answers

ready event on a posted form

I have a form in an iframe, when this form is posted a file is returned to the user (based on the form information). This file is returned using content-disposition:attachment so that only a file save dialog shows up. I want to do something in…
aepheus
  • 7,827
  • 7
  • 36
  • 51
0
votes
1 answer

HTML-form does not post back anymore after post with content-disposition

I don't know if it is a feature by design or something that I do wrong. On a webpage I have a HTML-form which after a post back generates a PDF-document. This document is provided via as content-disposition. The idea was that the current page…
Bojo
  • 381
  • 1
  • 5
  • 16
0
votes
1 answer

How to temporally deactivate onbeforeunload-message in combination with content-disposition: attachment?

I have one page insert.php where the user can make inputs into a form. I use javascript to inform the user about possible loss of inserted data when the page is closed.