content-disposition

How to rewrite and set headers at the same time in Apache

好久不见. 提交于 2019-12-05 21:46:12
I have a directory of images that alternately be viewed directly in the browser, and other times downloaded. So, say I have a file /gallery/gal_4254.jpg. I want to make /download/gal_4254.jpg trigger a download of the image rather than view it. /download is empty, all the images are in /gallery. I can map requests to the download dir to the other files successfully <Directory /var/www/download> RewriteEngine on RewriteRule (.*)$ /gallery/$1 </Directory> and I already can force downloads in the gallery dir by setting <Directory /var/www/gallery/> ForceType "image/jpg" Header set Content

Android browser media player (stagefright?) displayed media name

会有一股神秘感。 提交于 2019-12-05 20:22:51
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 The short answer is no. I don't think you can change the displayed title to show something else from the

Download excel file in javascript from Rest API response content-disposition outputs [Object, Object]

让人想犯罪 __ 提交于 2019-12-05 15:13:27
I want to download a excel file from my angularJs code. Where i made a http post request to Java Rest API and returned the file with header "Content-Disposition" : "attachment; filename=\"new_excel_file.xlsx\"" Java Code @Post @Path("/excel/trekResult") @Produces("application/vnd.ms-excel") public Response getResultsReport(@HeaderParam(Constants.ID) Long userId, @QueryParam(Constants.COMPANY_TREK_ID) Integer companyTrekId) { String CONTENT_DESPOSITION = "Content-Disposition"; String CONTENT_ATTACHEMENT = "attachment; filename=\"new_excel_file.xlsx\""; //Generates a excel file in local file

IE and Content-disposition inline vs. extension-token

喜欢而已 提交于 2019-12-05 12:04:00
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 XSS vectors. IE's mime sniffing (in unpatched IE6-, which I must support, e.g. IE6/Win2000) is one of

Keep getting old version, even after changing the Default Service Version on azure blob (inorder to set the content disposition header)

*爱你&永不变心* 提交于 2019-12-04 20:59:09
background: I'm trying to force the browser to download an image in response to a button (or link) click, instead of showing it inline. I need this to work cross browsers, so HTML5 attributes aren't enough. The Image is stored in a blob (azure storage services). What I tried: To set the DefaultServiceVersion to 2013-08-15 so the contentDisposition will work. (example from here Azure Storage API ContentDisposition ): var cloudStorageAccount = new CloudStorageAccount(new StorageCredentials("accountname", "accountkey"), false); var serviceProperties = cloudStorageAccount.CreateCloudBlobClient()

“Microsoft Edge PDF inline issue” Same Issue Again

佐手、 提交于 2019-12-04 10:35:16
问题 I'm still having the same issue that was previously reported and answered under Microsoft Edge PDF inline issue even though I'm not using the pre-release version of Win 10, but the latest downloaded though Windows Update. After upgrading my Win 8.1 Machine to Win 10, and tested my ASP.NET application, I faced an issue with displaying inline pdf files. Here's my C# code in my ASP.NET application: Response.Clear(); Response.ClearHeaders(); Response.ClearContent(); Response.ContentType =

Amazon AWS S3 to Force Download Mp3 File instead of Stream It

陌路散爱 提交于 2019-12-04 08:09:42
I'm using Amazon S3 to put the mp3 file then allow our site visitor to download the mp3 from Amazon AWS. I use S3Fox to manage the file, everything seems working fine until recently we got many complaints from visitor that the mp3 was streamed via the browser instead of displaying browser save dialog. I try for some mp3 and notice that for some mp3, the save dialog box is appear, and for some others they're streamed via browser. What can I do to force that the mp3 file will be downloaded instead of streamed via web browser.... Any help would be much appreciated. Thanks In order to do so you

PHP: send WORD document file to download

こ雲淡風輕ζ 提交于 2019-12-04 02:15:25
问题 This question is trivial and has many answers, all the same or nearly but for my case, it doesn't solve as expected? Goal: send WORD file as attachment with PHP (simple...) Mean: here is the code: // send the file to the browser header("Cache-Control: no-store"); header("Content-Type: application/octet-stream"); //header("Content-type: application/msword"); header('Content-Disposition: attachment; filename="'. basename($filename) . '"'); header('Content-Transfer-Encoding: binary'); header(

handling filename* parameters with spaces via RFC 5987 results in '+' in filenames

痞子三分冷 提交于 2019-12-03 14:25:14
I have some legacy code I am dealing with (so no I can't just use a URL with an encoded filename component) that allows a user to download a file from our website. Since our filenames are often in many different languages they are all stored as UTF-8. I wrote some code to handle the RFC5987 conversion to a proper filename* parameter. This works great until I have a filename with non-ascii characters and spaces. Per RFC, the space character is not part of attr_char so it gets encoded as %20. I have new versions of Chrome as well as Firefox and they are all converting to %20 to + on download. I

“Microsoft Edge PDF inline issue” Same Issue Again

余生颓废 提交于 2019-12-03 07:08:56
I'm still having the same issue that was previously reported and answered under Microsoft Edge PDF inline issue even though I'm not using the pre-release version of Win 10, but the latest downloaded though Windows Update. After upgrading my Win 8.1 Machine to Win 10, and tested my ASP.NET application, I faced an issue with displaying inline pdf files. Here's my C# code in my ASP.NET application: Response.Clear(); Response.ClearHeaders(); Response.ClearContent(); Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition","inline;filename=some.pdf"); Response.BinaryWrite