content-disposition

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

[亡魂溺海] 提交于 2019-12-10 00:58:27
问题 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(

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

谁都会走 提交于 2019-12-09 12:41:33
问题 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

Send file through POST without Content-Disposition in Python

南笙酒味 提交于 2019-12-08 03:06:12
问题 I am using requests in Python to send file over POST. My code looks like this: headers = {'Content-Type': 'application/x-tar', 'Content-Length': tar_size} r = requests.post(server, files={"file": (tar_name, open(tar_name, 'rb'))}, headers=headers) On the same server from another client (written in C) files are send the same way. When the body_file (webob stuff see here http://docs.webob.org/en/stable/api/request.html) is read, from the C client the file is read, however from my client in

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

纵饮孤独 提交于 2019-12-07 13:32:26
问题 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

Forcing the inline rendering of a PDF document in Rails

三世轮回 提交于 2019-12-07 08:06:13
问题 I'm writing a service that generates PDF files from a set of XML files. The PDF is being correctly generated. However, everytime I click on the "view PDF" link, the browser asks the user to download the PDF file. I need the PDF to display inline, just like any regular HTML page. I though I wrote the code right, but something must be missing - the browser keeps asking the user to download. Here's the current code: class PdfController < Controller def generate # stuff send_data pdf_bytes,

Java webapp: adding a content-disposition header to force browsers “save as” behavior

怎甘沉沦 提交于 2019-12-07 01:40:26
问题 Even though it's not part of HTTP 1.1/RFC2616 webapps that wish to force a resource to be downloaded (rather than displayed) in a browser can use the Content-Disposition header like this: Content-Disposition: attachment; filename=FILENAME Even tough it's only defined in RFC2183 and not part of HTTP 1.1 it works in most web browsers as wanted. So from the client side, everything is good enough. However on the server-side, in my case, I've got a Java webapp and I don't know how I'm supposed to

Send file through POST without Content-Disposition in Python

此生再无相见时 提交于 2019-12-06 05:16:11
I am using requests in Python to send file over POST. My code looks like this: headers = {'Content-Type': 'application/x-tar', 'Content-Length': tar_size} r = requests.post(server, files={"file": (tar_name, open(tar_name, 'rb'))}, headers=headers) On the same server from another client (written in C) files are send the same way. When the body_file (webob stuff see here http://docs.webob.org/en/stable/api/request.html ) is read, from the C client the file is read, however from my client in Python the real file is prepened with: --2a95cc93056b45e0b7c3447234788e29 Content-Disposition: form-data;

AWS S3: Force File Download using 'response-content-disposition'

ぃ、小莉子 提交于 2019-12-06 04:06:36
Few lines(below) generate signed URL to which browser is redirected to download a file from S3. I am facing well known issue of Chrome not downloading pdf files from S3 when content type is set as Octet Stream. The solution is to force chrome to download file instead of trying to read/open it. I tried adding 'response-content-disposition' to sign as well as URL, but it didn't work. How to use 'response-content-disposition' header when url is to be generated? String codedFilename= EncodingUtil.urlEncode(bucketPath,'UTF-8'); String stringtosign = 'GET\n\n\n'+Lexpires+'\n/'+bucketName+'/'

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

心已入冬 提交于 2019-12-06 02:55:32
问题 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

wget breaking with content-disposition

北战南征 提交于 2019-12-06 00:21:09
I am trying to download the kml file that is sent via Content-Disposition:attachment from the following website: http://waterwatch.usgs.gov/index.php?m=real&w=kml&r=us&regions=ia Using wget and curl with the command: wget --content-disposition http://waterwatch.usgs.gov/index.php?m=real&w=kml&r=us&regions=ia and curl -O -J -L http://waterwatch.usgs.gov/index.php?m=real&w=kml&r=us&regions=ia However, instead of saving the file being transmitter, it saves only the html content and at the end of the transmission it gets stuck. The terminal return is: $wget --content-disposition http://waterwatch