Search code examples
azure-storage

Azure File Storage Error: Condition Headers Are Not Supported


When attempting to download a PDF file to a browser directly from Azure File Storage I get this error:

<Error>
    <Code>ConditionHeadersNotSupported</Code>
        <Message>
            Condition headers are not supported. RequestId:a84ee68e-   001a-001b-4223-bff5e7000000 Time:2017-04-27T06:57:22.2002199Z
        </Message>
</Error>

Edge: Blank page or blank page with frozen loading indicator.

FireFox: Second time, shows dialog to download file.

Chrome: Blank page or When PDF Documents “Open PDF files in default PDF viewer application” setting is checked, shows dialog to download file.

IE: Shows dialog to download file.

Safari: Displays PDF.

The behavior can be seen here:
https://peachstatepca.file.core.windows.net/content/newsletters/PresseApril2017.pdf?sv=2016-05-31&sr=f&sig=rkQEmY6IWXZqcgvhmm00gLQ%2FCZEq6nsH95S3aP9T72A%3D&se=2017-05-01T11:46:18Z&sp=r


Solution

  • Azure File Storage Error: Condition Headers Are Not Supported

    Since the new Edge browser will not have any support for ActiveX plug-ins. Therefore, Acrobat/Reader plug-in won't work with Edge. We can get more details for Change in support for Acrobat and Reader plug-ins in modern web browsers and Microsoft Edge: Building a safer browser.

    Edit:

    If we try to download the PDF file with Edge in the private and develop mode, we can get the error message "Something’s keeping this PDF from opening" and also can know that edge browser has sent 2 requests. And second request with Header 'If-range'. According the Azure file storage Get File API, there is no specifying Conditional Headers If-Range supported. I also find a similar issue about edge browser.

    enter image description here

    I also test in the Firefox and Chrome, then just get the 1 request.

    enter image description here

    Note: For Azure Blob Service, the pdf file can be opened correctly from the edge browser. As Blob Get Blob API that supports a successful operation to read the full blob returns status code 200 (OK) and a successful operation to read a specified range returns status code 206 (Partial Content).