Generating signed URL for a file download
This lesson describes how to generate a signed URL for a file download
Code: /lessons/Generating_signed_URL_for_a_file_download
In this example, the function code accepts the bucketName and the sourceFilePath as input parameters. It fetches the signed URL link which can be used to download the file.
Prerequisite
The same file as the one used in the previous example .
Steps
Create a new function called GeneratingSignedUrl.java.
Upload a file to the GCS bucket.
Set passed parameters as the name of the bucket and file path.
Call StorageApi.getSignedUrl function with the above parameters.
Return the signed URL response in the form of a Result.
Last updated