Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8574725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:32:17+00:00 2026-06-11T19:32:17+00:00

I am very new to the google cloud storage. I want to create folder

  • 0

I am very new to the google cloud storage.

I want to create folder in bucket using php coding. I have searched a quite few sites and on 1 i saw it was written:

"Creating a folder inside a bucket will create a placeholder object named after the directory, has no data content and the mimetype application/x-directory. Directory placeholder objects created in Google Storage Manager are ​not supported."

I could not understand what it is trying to say. How can i create folder please help me out. I tried using the following code:

$req = new Google_HttpRequest("http://commondatastorage.googleapis.com/bucket/myfoldertrial");
$req->setRequestHeaders(array(
'x-goog-project-id' => 21212,
'x-goog-acl' => 'public-read',
'Content-Type' => 'application/x-directory'
));
$req->setRequestMethod('PUT');
$req->setPostBody('myfoldertrial');

I am using the API from following link:

Google API for PHP

Please help me out creating folder using PHP.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:32:18+00:00Added an answer on June 11, 2026 at 7:32 pm

    You probably don’t actually need to create a folder.

    Google Storage isn’t a tree structure like your operating system’s filesystem uses, all Objects are stored in buckets at the top level. However you can give an Object a name with slashes in it, so it will kind of look like it is in a folder – Users/username/docs/2012/09/21/activity.csv is a perfectly good name for an Object and doesn’t need any supporting folders.

    Once you’ve got Objects with this sort of scheme in place, you can list them as if you were viewing the contents of a folder with the delimiter and prefix parameters as per these docs.

    So if you only wanted to create myfoldertrial so you could upload example.png into it, there’s no need to create the folder, you can just upload straight to myfoldertrial/example.png.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am very new to OpenLayers, been using Google Maps for awhile but want
I'm very new to VBA and i searched and searched on Google, but can't
I am new to Google Maps, so I have most likely missed something very
I'm very new at windows phone coding and I have what I think is
I'm very new at using JS and AJAX. Currently I'm working with Google Maps
I have made a very simple page using google maps API with several fields
I am storing a file in Google App Engine using Google Cloud Storage. The
I am very new to BigQuery by google I want to parse time stamp
I'am very new to google-apps-script. I encounter this error TypeError: Cannot find function getValue
I'm new to the very concept of the Google Web Toolkit (GWT) and as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.