locked
Blob storage and expired links RRS feed

  • Question

  • Hi, I have a blob storage and provide download links to the user. If a link expired, the ser get a xml file for download. 

    XML:

    <Error>
    <Code>AuthenticationFailed</Code>
    <Message>
    Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:df3b-e01e-0a5-4a3d-0d000000 Time:2018-11-10T21:36:20.0951989Z
    </Message>
    <AuthenticationErrorDetail>
    Signature not valid in the specified time frame: Start [Fri, 09 Nov 2018 09:34:46 GMT] - Expiry [Sat, 10 Nov 2018 09:34:46 GMT] - Current [Sat, 10 Nov 2018 21:36:20 GMT]
    </AuthenticationErrorDetail>
    </Error>

    This is correct, but how I can "say" azure to server html to the user browser with this error message, instead xml file for download?

    Thanks!

    Adi

    Tuesday, November 13, 2018 1:22 PM

All replies

  • Hi,

    In order to open the file in the browser instead of downloading it, you will need to set the content-type property of the blob. For XML, you should be able to set the content-type to "application/xml".

    By using the Azure Storage REST API, you can use the Set Blob Properties operation and specify the content-type in the request header to do this as mentioned in the following guide: https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties#request-headers-all-blob-types

    If this answer was helpful, click “Mark as Answer” or Up-Vote. To provide additional feedback on your forum experience, click Here

    Thursday, November 15, 2018 1:00 PM