All Products
Search
Document Center

Function Compute:Return results are forcibly downloaded when I access an HTTP function through a browser. How do I resolve this issue?

Last Updated:Feb 20, 2024

Starting from November 19, 2018, when a function is triggered by an HTTP trigger, the server forcibly adds the content-disposition: attachment field in response header. As a result, the return results are open as attachments in the browser.

To avoid forced downloads, you can use the following methods:

  • Use a test domain name. In the Function Compute console, click the test domain name on the HTTP trigger details page to download and run the configuration script. After that, you can use the test domain name to access the function in a browser.

  • Specify to access the function through the custom domain name instead of the default domain name aliyuncs.com of Function Compute. For more information, see Configure a custom domain name.

  • Add the content-type: text/html response header configuration.