Topic 1 Question 48
You host a static website on Cloud Storage. Recently, you began to include links to PDF files on this site. Currently, when users click on the links to these PDF files, their browsers prompt them to save the file onto their local system. Instead, you want the clicked PDF files to be displayed within the browser window directly, without prompting the user to save the file locally. What should you do?
Enable Cloud CDN on the website frontend.
Enable 'Share publicly' on the PDF file objects.
Set Content-Type metadata to application/pdf on the PDF file objects.
Add a label to the storage bucket with a key of Content-Type and value of application/pdf.
ユーザの投票
コメント(17)
C is correct
👍 23berezinsn2020/05/25- 正解だと思う選択肢: C
ANSWER A, enabling Cloud CDN on the website frontend, is not relevant to displaying PDF files in the browser. Cloud CDN is a content delivery network that caches content at edge locations around the world to reduce latency and improve website performance.
ANSWER B, enabling "Share publicly" on the PDF file objects, only controls whether or not the files are accessible to users without authentication. It does not affect how the files are displayed in the browser.
ANSWER D, adding a label to the storage bucket with a key of Content-Type and value of application/pdf, is not the correct way to set the Content-Type metadata for individual objects. Labels are used for organizing resources, while metadata is used to provide information about the data itself.
Therefore, ANSWER C, setting Content-Type metadata to application/pdf on the PDF file objects, is the correct answer.
👍 14Buruguduystunstugudunstuy2023/02/19 Option C: To display PDF files directly within the browser window on a website hosted on Cloud Storage, you can follow these steps:
In the Google Cloud Console, navigate to the Cloud Storage section and select the "Buckets" page.
Select the bucket that contains the static website and the PDF files.
From the "Actions" menu, select "Edit bucket" and then go to the "Website" tab.
In the "Website Configuration" section, select the "Serve objects with this content type" option and enter "application/pdf" in the text field. This will cause PDF files to be served with the correct content type.
Save the changes to the bucket configuration.
After completing these steps, the PDF files on your website will be served with the correct content type and will be displayed directly within the browser window when clicked, without prompting the user to save the file locally.
👍 12Paulo_Jorge2022/12/09
シャッフルモード