content-disposition

Content-Disposition with 302 redirect

岁酱吖の 提交于 2019-12-17 20:52:02
问题 This was working last night, but I must have accidentally changed something, because it isn't now. What I am trying to do should be clear from these headers: Content-Disposition: attachment;filename=english_customizable.xml Location: http://tortoisewrath.com/files/2.xml However, when this header is sent, the Content-Disposition part doesn't work after the redirect. ...Why? 回答1: What you're trying to do is inadvisable check this question; Header Location + Content Disposition Content

Is Content-Disposition attachment blocked from XMLHttpRequest?

南楼画角 提交于 2019-12-17 19:01:48
问题 I want to perform a javascript xhr request for a png file from a C# webserver which I wrote. Here is the code I use var imgUrl = "http://localhost:8085/AnImage.png?" + now; var request = new XMLHttpRequest(); request.open('GET', imgUrl, false); request.send(); // this is in a try/catch On the server-side I send back the file and add a Content-Disposition header. I obtain the following response I made sure that Content-Disposition was attached in the headers after the Content-Type (the

Android browser media player (stagefright?) displayed media name

与世无争的帅哥 提交于 2019-12-12 09:49:16
问题 When the Android browser opens a media file it can play, the built-in (stagefright?) media player opens up to stream it. A title for this media is displayed on the player dialog, based on the URL. The URL in this case was http://10.0.37.195/waug_mp3_128k . The media player simply uses the last part of the path as its title. Is it possible to change the displayed title? I have tried a Content-Disposition header, but it had no effect: Content-Disposition: inline; filename=Some Better Title 回答1:

Content-Disposition: inline for PDF file in ASP.Net not working

无人久伴 提交于 2019-12-11 05:08:35
问题 I am trying to return PDF file to browser with header Content-Dispostion:inline right after I am creating this file. Viewers of browser have problem to open it. File is not corrupted. If I put into browser, viewer shows file correctly. But I want create file and check users rights for file at one request. Here is my headers and response set up: HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ClearHeaders(); HttpContext.Current.Response.ClearContent(); HttpContext.Current

Download contents of the PHP generated page from another PHP script

可紊 提交于 2019-12-11 04:54:44
问题 I have a PHP script on a server that generates the XML data on the fly, say with Content-Disposition:attachment or with simple echo, doesn't matter. I'll name this file www.something.com/myOwnScript.php On another server, in another PHP script I want to be able to get this file (to avoid "saving file to disk") as a string (using the path www.something.com/myOwnScript.php) and then manipulate XML data that the script generates. Is this possible without using web services? security implications

Supress the Save as dialog in Chrome

折月煮酒 提交于 2019-12-11 02:17:27
问题 If I'm making a Chrome Extension, how do I open an image in a new tab, if server forces the "Save as..." dialog? As I can see, it is something about the Content-Disposition header property. There are dozens of server-side Q/A about how to force browser to open that dialog, but I can't find nothing, how to fight with that as an end-user, who doesn't want that dialog window. 回答1: In the extended BNF notation of [RFC 822], the Content-Disposition header field is defined as follows: disposition :

Include Content-disposition header for Django FileUpload

丶灬走出姿态 提交于 2019-12-10 14:57:35
问题 I defined an API endpoint which accepts a file (e.g. using Django REST Framework). In Django, the content disposition header can be used when inspecting the response. https://docs.djangoproject.com/en/1.11/ref/request-response/#telling-the-browser-to-treat-the-response-as-a-file-attachment Now, if we want to set the header when testing the endpoint, how do I include this header using REST-Framework's APITestCase? What I tried so far is, but it does not seem to accept the headers. class

Content-Disposition Filename not working on IE

核能气质少年 提交于 2019-12-10 13:40:13
问题 I am working on an asp.net/c# web application that allows users to view and download PDF files. When I am clicking on a file, I get to view that in the PDF reader available in the browser, and when I save it, the file should be saved with the name that I have passed via headers. But this is not the behavior in IE7 & IE8 FileInfo f = new FileInfo(FileName); Response.ContentType = "application/pdf"; Response.AddHeader("Content-Disposition", "inline; filename=" + f.Name) When I click to save a

Chrome adds “-, attachment” to downloaded file

大憨熊 提交于 2019-12-10 12:56:14
问题 I use Symfony2 Framework and use the following code to export an xml file: $response->setStatusCode(200); $response->headers->set('Content-Type', 'application/xml'); $response->headers->set('Content-Description', 'Submissions Export'); $response->headers->set('Content-Disposition', 'attachment; filename="' . $filename .'"'); $response->headers->set('Content-Transfer-Encoding', 'binary'); $response->headers->set('Pragma', 'no-cache'); $response->headers->set('Expires', '0'); I does not matter

IE and Content-disposition inline vs. extension-token

筅森魡賤 提交于 2019-12-10 09:25:32
问题 Preamble So IE does Mime-Type sniffing. That part's old news. Suggestions of how to combat it tend to be along the lines of 'supply a content-type IE trusts' (i.e. anything that isn't text/plain or application/octet-stream) or 'add extraneous data at the start of the file that is definitely of the type you're serving'. Now, I'm working on an application that has to allow message attachments (like in e-mails), occasionally to be displayed inline (again like in e-mails), and we want to close up