Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I upload files to google cloud storage from url?

Tags:

Code Exemple:

gsutil cp "http://www.exemple.com/file.txt" "gs://bucket/" 
like image 718
user2661319 Avatar asked Aug 07 '13 15:08

user2661319


People also ask

How do I upload data to Google Cloud Storage?

In the Google Cloud console, go to the Cloud Storage Buckets page. In the list of buckets, click on the name of the bucket that you want to upload an object to. In the Objects tab for the bucket, either: Drag and drop the desired files from your desktop or file manager to the main pane in the console.

How do you upload the file to a cloud location and share the URL?

Click on "Remote Upload" in Google Drive tab to trigger the upload file via URL link window. In the pop up window, enter/paste the source file URL link address.

How do I import a CSV file into Google Cloud Storage?

Select All Settings > Raw Data Export > CSV Upload. Select Google Cloud Storage from the dropdown menu. Upload your Service Account Key credential file. This is the JSON file created in the Google Cloud Console. Enter your Google Cloud Storage bucket name.

How do I get a signed URL for Google Cloud Storage?

Options for generating a signed URL Simply specify Cloud Storage resources, point to the host storage.googleapis.com , and use Google HMAC credentials in the process of generating the signed URL.


2 Answers

You can stream the output of curl to the gsutil cp command as follows:

curl http://www.example.com/file.txt | gsutil cp - gs://bucket/file.txt 
like image 105
rein Avatar answered Sep 27 '22 20:09

rein


There is Cloud Storage Transfer Service with an option to upload list of URLs though not very simple and more batch-oriented.

like image 39
Qrilka Avatar answered Sep 27 '22 19:09

Qrilka