Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
කිතුල් තලප
Manoj Suranga Bandara
Updated:
Today at 7:04 PM
Ad icon
ව්යාපාර, Tuition පන්ති සහ Personal Portfolios සඳහා Web Setup එකක් රු. 9,099/- කට (වාර්ෂික renewal ර
thathsilura
Updated:
Thursday at 6:17 PM
AWS Certified Solutions Architect-Associate + AWS Certified Cloud Practitioner
Sanjeewani95
Updated:
Aug 19, 2026
🚀 එක පැකේජ් එකයි - මාසෙටම Unlimited Internet! 🌐
sayuru bandara
Updated:
Aug 18, 2026
🎬 CapCut Pro 1 Month Access! LKR 600
sayuru bandara
Updated:
Aug 18, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
Computers & Internet
Problems and Troubleshooting
Google Bucket storage ගැන දන්න අයගෙන් හෙල්ප් එකක් ඔනේ.
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="gamerlk" data-source="post: 29557789" data-attributes="member: 585666"><p>kothanda hira une?</p><hr /><p>chatgpt gave this.</p><p></p><p>[CODE=bash]#!/bin/bash</p><p></p><p># Set your Google Cloud Storage bucket name and local directory path</p><p>BUCKET_NAME="your-bucket-name"</p><p>LOCAL_DIRECTORY="/path/to/local/directory"</p><p></p><p># Set your Google Cloud Storage API endpoint</p><p>API_ENDPOINT="https://storage.googleapis.com"</p><p></p><p># Check if the local directory exists</p><p>if [ ! -d "$LOCAL_DIRECTORY" ]; then</p><p> echo "Error: Local directory not found: $LOCAL_DIRECTORY"</p><p> exit 1</p><p>fi</p><p></p><p># Iterate through files in the local directory and upload them to the bucket</p><p>for file in "$LOCAL_DIRECTORY"/*</p><p>do</p><p> if [ -f "$file" ]; then</p><p> FILE_NAME=$(basename "$file")</p><p> UPLOAD_URL="${API_ENDPOINT}/${BUCKET_NAME}/${FILE_NAME}"</p><p></p><p> # Make a PUT request to upload the file</p><p> curl -X PUT --upload-file "$file" "$UPLOAD_URL"</p><p></p><p> # Check the HTTP status code</p><p> if [ $? -eq 0 ]; then</p><p> echo "File '$FILE_NAME' uploaded successfully!"</p><p> else</p><p> echo "Error: Failed to upload file '$FILE_NAME'."</p><p> fi</p><p> fi</p><p>done[/CODE]</p><p>------ <span style="font-size: 10px">Post added on [DATETIME="UT"]1706635926[/DATETIME]</span></p></blockquote><p></p>
[QUOTE="gamerlk, post: 29557789, member: 585666"] kothanda hira une? [HR][/HR] chatgpt gave this. [CODE=bash]#!/bin/bash # Set your Google Cloud Storage bucket name and local directory path BUCKET_NAME="your-bucket-name" LOCAL_DIRECTORY="/path/to/local/directory" # Set your Google Cloud Storage API endpoint API_ENDPOINT="https://storage.googleapis.com" # Check if the local directory exists if [ ! -d "$LOCAL_DIRECTORY" ]; then echo "Error: Local directory not found: $LOCAL_DIRECTORY" exit 1 fi # Iterate through files in the local directory and upload them to the bucket for file in "$LOCAL_DIRECTORY"/* do if [ -f "$file" ]; then FILE_NAME=$(basename "$file") UPLOAD_URL="${API_ENDPOINT}/${BUCKET_NAME}/${FILE_NAME}" # Make a PUT request to upload the file curl -X PUT --upload-file "$file" "$UPLOAD_URL" # Check the HTTP status code if [ $? -eq 0 ]; then echo "File '$FILE_NAME' uploaded successfully!" else echo "Error: Failed to upload file '$FILE_NAME'." fi fi done[/CODE] ------ [SIZE=2]Post added on [DATETIME="UT"]1706635926[/DATETIME][/SIZE] [/QUOTE]
Insert quotes…
Verification
Payakata winadi keeyak tibeda?
Post reply
Top
Bottom