Force file download for IE9 on Azure Blob Storage
Hello,
I am trying to use Azure Blob Storage as a location for secure file downloads using Shared Access Signature. Everything is working very well, however the problem I am having is I am trying to allow the user to save files from the browser and I have all browsers
except IE9 working.
Reviewing this question,
What content type to force download of text response?
this works well when I can control all of the headers, however in Azure Blob Storage, I have set the Content-Type to application/octet-stream and this allows all browsers except IE to ask the user to save the file, IE simply opens the file. It appears that
known file types will open (example .jpg, .wmv etc…).
In Azure, I have found no way to set
Content-Disposition: attachment;filename="My Text File.txt"
Is there a way, using Azure Blob Storage, to use IE to download any file directly from Azure Blob Storage?
Thanks in advance.
Hi,
Actually, we can't set Content-Disposition for blobs, and I can't think of any other workarounds. From my experience, in most case IE's behavior is fine. I would like to know why you have to prompt a download? The user can see the text file, and
if they wish to save it locally, they have more than one way to do that (copy paste, save file, etc.). If they simply want to read the text and then forget it, that's also fine. They don't even have to download it and then double click a local file to read
the content.
If you have to modify the behavior, the only workaround I can think of is to use a web role as an intermediate bridge, and add the Content-Disposition from your web role.
Best Regards,
Ming Xu.
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact
[email protected]
Microsoft One Code Framework
Similar Messages
-
Streaming files from Azure Blob Storage through Node.js server
Hello,
I am currently trying to implement download server with Node.js Express app in a way that website visitors would be able to download files via stream straight from Azure Blob storage - so the server won't need to download files to its local storage. Here's
how I do that:
outStream is the response object (res) received by Express router; blobSvc is initialized like this:
blobSvc = azure.createBlobService(conf.azureStorageConfig.account, conf.azureStorageConfig.key, conf.azureStorageConfig.host);
. There are several issues I face, for example - while small files get downloaded well, the bigger ones (even 40 MB) do not finish the download successfully, throwing an error in console:
It has to be mentioned that the files are zip-archives, and while the error is thrown, the file is not completely downloaded to the client's machine - the archive is broken.
There are other issues, like the fact that the client can't download more than 1 file from the server simultaneously - he gets response timeout after trying to start downloading the second file.
What is the right way to use streaming with azure storage library in Node for client downloads?
Best Regards,
Petr.
Arction Ltd.Hi,
Thank you for posting in here.
We are checking on this and will get back at earliest.
Regards,
Manu Rekhar -
HT1386 my ipad 4 wont restored and i need ipsw file download for A1460
my ipad 4 restored and show itunes sync picture on display tablet & i need download ipsw file download for update my divice ios7.1.1 that compatible my ipad 4 - the serial number is A 1460
summary:
i need ipsw file for download and mack by itunes overhall my divicecuz me too same case I have also I lost all my photos 800pics
-
How to Secure or mask the Video Streaming on Azure Blob Storage
I have a problem on using my Azure Blob Storage, this is for streaming specifically MP4 files.
I have a wordpress site and I use Azure Blob Storage for my Storage, I use CloudberryExplorer for my browsing and editting
My problem is that, the wordpress site Video Option which is MediaElemtJs have an exposed Video Source (This mean they can use the video source for their own project)
Is their a way to mask or hide the video source? or I can limit the video source that it should only be coming from my sitehi Franz,
Base on my experience, there has two approaches for this issue.
1.Using the SAS in js request.
Like this:
<source src="https://MY-AZURE-STORAGE.blob.core.windows.net/asset-b1ebfc63-4e1f-4c76-b2dd-b040113aa493/MigratingWebSitesAndDatabasesToWindowsAzure_mid.mp4?sv=2012-02-12&st=2013-09-03T17%3A17%3A20Z&se=2015-09-03T17%3A17%3A20Z&sr=c&si=efc57c3c-a025-41cd-a8b1-908231c7aed2&sig=xyiIxmqNdF%2Bo1x7eq89xCUgXkenZLEEpq%2B%2Bo715dT0U%3D" type="video/mp4">
Please see this blog:http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-shared-access-signature-part-1/
You could set the start time,expire time and permission into your request. And you could use javascript to create the request and set src value. please see this sample (http://gauravmantri.com/2013/02/16/uploading-large-files-in-windows-azure-blob-storage-using-shared-access-signature-html-and-javascript/
2.Create a web handler to handle the request url
You could create a .ashx page and handle the url in .ashx page. Like this:
<video src="videos.ashx?source=file.mp4" width="640" height="480" controls></video>
Please try it.
Also, you could see this threads
http://stackoverflow.com/questions/9756837/prevent-html5-video-from-being-downloaded-right-click-saved form some ideas.
Regards,
Will
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Connect SAP BO Data Services to Azure Blob Storage
Hi,
I want to connect SAP BO Data service to Azure Blob Storage. Is there a way to achieve this?
Thanks,Hi Anton,
As of now, it is not possible for SAP BO Data Services to connect with Azure Blob Storage. However, you may put down your requirement in Azure Feedback, so that concerned development team can get it done in near future.
http://feedback.azure.com/forums/34192--general-feedback
Regards,
Manu Rekhar -
Hi,
My application deployed on azure, and I managed all my file to blob storage.
When i created container with public permission then it accessible for all anonymous users. When i hit URL of file (blob) from different browser, then i will get that file.
In Our application we have some important file and images that we don't want to expose. When we render HTML page then in <img> tag we define src="{blob file url}" when i mention this then public file are accessible, but same URL i copied
and hit to anther browser then still it is visible. My requirement is my application domain only able to access that public file in blob storage.
Amazon S3 which provide bucket policy where we define that for specific domain only file will accessible. see http://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html
Restricting Access to a Specific HTTP Referrerhi Prasad,
Thanks for your post back.
All of SAS and CORS could work, but not comprehensive.
For your requirement, " My requirement is my application domain only able to access that public file in blob storage.", If you want to stop the other domain site access your blob, you may need set the CORS for your blob. When
the origin domain of the request is checked against the domains listed for the
AllowedOrigins element. If the origin domain is included in the list, or all domains are allowed with the wildcard character '*', then rules evaluation proceeds. If the origin domain is not included, then the request fails. So other domain didn't access
your resource. You also try the Gaurav's blog:
http://gauravmantri.com/2013/12/01/windows-azure-storage-and-cors-lets-have-some-fun/
If you access CROS resource, you also need use SAS authenticated.
However SAS means that you can grant a client limited permissions to your blobs, queues, or tables for a specified period of time and with a specified set of permissions, without having to share your account access keys. The SAS is a URI that encompasses
in its query parameters all of the information necessary for authenticated access to a storage resource (http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-shared-access-signature-part-1/
). So if your SAS URI is available and not expired ,this URI could be used to other domain site. I think you can try to test it.
If I misunderstood, please let me know.
Regards,
Will
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Azure blob storage can not load file
I am trying to follow the MSDN tutorial on creating a container in blob storage and am getting the following error:
Additional information: Could not load file or assembly 'Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I have tried numerous stack overflow suggestions such as this
one , to no avail. I have also tried uninstalling Azure storage, and re-installing it as well. Just in case it is helpful here is my test case for Azure storage:
public void TestCloudStorage()
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"]);
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("pictures");
container.CreateIfNotExists();
Thank you in advance for your help!HI
I know what happend, that's the Nuget Package error.
Azure Storage nuget package 3.0+ have this error.
My solution is use Azure nuget package 2.1+
1 delete all the dll reference for Azure storage (Or recreate a new project)
2 input below command in package Manager console
Install-Package
WindowsAzure.Storage -Version 2.1.0.4
That will resolve your problem absolutely .
Aslo you can refer to other peoples solution.
http://stackoverflow.com/questions/20457846/missing-microsoft-data-services-client-version-5-6-on-azure-websites
My Blog
Please use Make as Answer if my post solved your problem and use
Vote As Helpful if a post was useful. -
Force file download? Content-Disposition?
Hello,
I recently started using an X-Serve with OS X 10.4.8 installed.
This is my media server, and I'm trying to configure it to force a file download dialog when an mp3 file is pulled.
I used to do this by using an .htaccess file with the following:
<FilesMatch "*.mp3">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
But it doesn't seem to work now.
Do I have to add a new Content Handler? If so, what do I put to force a file download?
Thanks very muchSee Oracle Metalink,
..Oracle Portal Technical Forum,
....Subject: PORTAL - uploading files (file attachments) with file names.
This message thread outlines javascript code that automatically captures the filename during an upload. -
Hi,
I'm starting to use Azure Java APIs; blob storage to be precise. I would like to know more about the Storage SDK. Have a specific question about Azure Storage SDK:
Does it use REST APIs internally to store and retrieve files? How about the performance?
Note: I'll be running all my code on a Azure Virtual Machine.
Thanks in advance.You might want to post this in storage forum. Just my thoughts (not authoritative)
I am not sure about the performance. I will expect Java SDK to use the REST service and performance targets are specified here.
https://msdn.microsoft.com/en-us/library/azure/dn249410.aspx. Assuming you are trying to do read from with in the same region, performance should be good.
Another tip to improve the performance is to create an affinity group and have virtual machines and storage accounts created with in same affinity group (which should give better performance, as affinity group is a small/nearby set with in a single region).
More than API performance, I will suggest to choose the right design for your blob types, based on your requirements.
https://msdn.microsoft.com/en-us/library/azure/ee691964.aspx -
Error when connecting to windows azure blob storage
While trying to upload an image to blob storage i keep getting can connect to ****.blob.core.windows.net
try {
//Get the rocket data
FileInputStream fis = new FileInputStream(mFilePath);
int bytesRead = 0;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
byte[] b = new byte[1024];
while ((bytesRead = fis.read(b)) != -1) {
bos.write(b, 0, bytesRead);
byte[] bytes = bos.toByteArray();
fis.close();
// Post our rocket data (byte array) to the server
URL url = new URL(mBlobUrl.replace("\"", ""));
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("PUT");
urlConnection.addRequestProperty("Content-Type", "image/jpeg");
// Write image data to server
DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream());
wr.write(bytes);
wr.flush();``
wr.close();
int response = urlConnection.getResponseCode();
//If we successfully uploaded, return true
if (response == 201
&& urlConnection.getResponseMessage().equals("Created")) {
return true;
} catch (Exception ex) {
Log.e(TAG, ex.getMessage());Hi,
What detailed error have you encountered? Please try to add content-length as below, hope it helps, if not, please give more information here.
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod("PUT");
urlConnection.addRequestProperty("Content-Type", "image/jpeg");
urlConnection.setRequestProperty("Content-Length", ""+ bytes.length);
Best Regards,
Jambor
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
File download for OrdAudio type
Hello
I would like to ask why my filedownload link is not displayed. I am using type OrdAudio for Audio files. Do I have to use OrdDoc for this. Is this the reason for JHS not showing the download link
EsmaEsma,
I'm no authority on this but isn't the MediaPlayer thing something that is configured on the Browser? Often when downloading audio content from the web, you get this dialog asking whether MediaPlayer should play it inside the browser, and whether to remember this setting in future (per site, I think).
Kind regards,
Peter Ebell
JHeadstart Team -
How to force file download message box appear????
I download file from oracle
how to set response header to make download message box appear??????
I just see lots of :
���?������ Y�Dl?��>��hn��?g�x~����?7���}��h`a�F��?P?!P��*�X��?/?U ��A?|?/??$�T=��t ��?^!i��f��/?]?�c��7?�UZ�Gz?��SbU��p���Q�T������?��e JyN�/�X^��w��/Bo�k�O��������^��$��?�������yg���C(??[�[+?��R�����p��?te@?��o��?M:D�_s#h�����H��g/?�nE"�PQI���A!��bE������?C`A�������?V��2�^��<�NK?[��k�k$??yJ>?sg-hm�AW(���S��?l[��[���� ��?dL4��6!�N��*���N?Q2?���JoP��>|�sb�_�^�_����~�r��X
on the screen
I am a chinese, happy new year everyone!and the file.size() is semicode, meaning there isnt a function for it. So you might end up with something like this
response.setContentType( "application/zip" );
String fileName = Globals.getAttachmentLocation() + readFile;
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
BufferedInputStream bufferedInputStream = new BufferedInputStream( new FileInputStream( fileName ) );
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
int start = 0;
int length = 1024;
byte[] buff = new byte[length];
while ( bufferedInputStream.read( buff, start, length ) != -1 ) {
byteArrayOutputStream.write( buff, start, length );
bufferedInputStream.close();
response.setContentLength( byteArrayOutputStream.size() );
response.getOutputStream().write( byteArrayOutputStream.toByteArray() );
response.getOutputStream().flush(); -
Bundle File download for userDetail
Hi,
From where i can download bundle file for userDetail metadata extension.
File name com.sap.ip.collaboration.coreui.api.people.flexibleui.PeopleBundle
Regards
Babyprobably this exception is coming bez of not able to find the "far" file ext.
Try this might hlep you
WDWebResourceType FILE_EXT = WDWebResourceType.DOC;
thanks -
Wrong file Downloaded for 9ias_aspkit_1200.zip
Tried to download Oracle9iAS Migration Kit for ASP software from the following web page, URL:http://otn.oracle.com/software/tech/migration/asp/content.html
link: 9ias_aspkit_1200.zip (46,606,647 bytes)
The file that downloaded from that link was: 9iAS_aspkit_1200.tgz
from: http://download.oracle.com/otn/nt/omwb/asp/
The links to the other two options appear to go the files indicated on the web page for Solaris and linux but not the zip file.Thanks -- this will be fixed today.
Regards,
OTN -
File Download for custom extension
Hai friends,
I have a task in which i need to download a file( <filename>.far), which is user defined extension.
how can define a WDWebResourceType ?
I used the code line
WDWebResourceType FILE_EXT = WDWebResourceType.getWebResourceTypeForFileExtension("far");
but it returns null.
Thanks
krishprobably this exception is coming bez of not able to find the "far" file ext.
Try this might hlep you
WDWebResourceType FILE_EXT = WDWebResourceType.DOC;
thanks
Maybe you are looking for
-
Envy dv6 notebook - Hard drive failure - How do I get windows 8 reloaded on my Notebook
Hard drive failed in the notebook / laptop. How do I get windows 8 back on the new drive? Hp told me they will not send or sell me recovery disks. WHat kind of crap is that? Help!
-
How to use perform and endperform in scripts
Can anybody cleaerly explains me how to use perform and endperform in scripts with an example to add something extra dynamically to the standard script (like rvorder01). thanks in advance. regards anil.
-
Flash Builder 4.6 Not Recognizing Valid CS 5.5 Premium Serial Number
I have downloaded and attempted to install Flash Builder 4.6 over the install of FB 4.5 that came with Web Premium 5.5 The serial number from my original install is not recognized as a valid serial number for FB 4.6 I am hesitant to uninstall FB 4.5
-
How to control the cursor position on a text item..
Hello, How can we control the cursor position programmatically on a text item. i.e. how do we move the cursor to home or end of the text item. TIA, Hiten
-
Powerpivot - "Column F51 missing from rowset"
Hi, I've set up a powerpivot not long ago from an existing Excel sheet and there's an issue that keeps coming up randomly. When I refresh the pivot that feeds off from the other Excel sheet some of my pivots (depending of the source tab) are returnin