
Answer-first summary for fast verification
Answer: Set the content-type as object metadata to application/pdf on the files
The correct answer is **B** because the browser requires the correct content-type to interpret and render the file properly. The content-type should be set to `application/pdf` on the object metadata, not the bucket. This ensures the PDF opens in the browser as intended. - **Option A** is incorrect because `application/octet-stream` is a generic binary data type, not specific to PDFs. - **Option C** is incorrect for the same reason as A, plus the metadata should be set on the files, not the bucket. - **Option D** is incorrect because the metadata should be applied to the files, not the bucket. For more details, refer to the [GCP documentation on Cloud Storage Object Metadata](https://cloud.google.com/storage/docs/metadata#content-type).
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Your company hosts a static website on Cloud Storage. After adding PDF files, users find that clicking a PDF link downloads the file instead of opening it in the browser. What change would you implement to resolve this issue?
A
Set the content-type as object metadata to application/octet-stream on the bucket
B
Set the content-type as object metadata to application/pdf on the files
C
Set the content-type as object metadata to application/octet-stream on the files
D
Set the content-type as object metadata to application/pdf on the bucket
No comments yet.