How to create folders in r2 bucket?

I want create folders like

But I can do only

There are no any options to create folders. Only options to upload or drag and drop Folders.

But I am using android. Which not support folders upload to browser. i can only upload direct files.

Please anyone can help to upload or create folders in r2 bucket storage?

You are correct, there is no way to select a folder for upload in any Android browser that I know of. And it’s impossible to create a folder without a file in it. That’s because in R2 the entire file path is simply part of the file name. There are no real folders, no real file paths. So what you want to do is create a file named “wp-includes/js/jquery/jquery.min.js”. But of course, that too is impossible through the upload feature.

R2 is brand new and a lot of features are being developed, so you might see a feature added soon that will make this possible. Even the folder upload feature didn’t exist last time I checked. You can however use rclone to upload entire folders, and you can use the R2 Postman collection to upload files with slashes in their name (basically file paths).

In the mean time we might be able to help you if we understand what you are trying to achieve. For instance, hosting an entire WordPress website on R2 isn’t going to work because it won’t interpret PHP code. Even if it did, it would certainly be against the terms of service.

If you’re only trying to host your static WordPress files on R2 to increase the speed of your website and decrease the load on your server, then you don’t need R2. You can simply achieve this by proxying your website through Cloudflare, they will edge cache files up to 500mb which should cover any static WordPress files, and then some. The performance of edge caching is much better than R2 as well. Moreover, if you put your static files under 500mb in to R2 and serve them over a public bucket url, they will end up in edge cache all the same.

I’m unsure if this approach would help you achieve what you want to, but if you supply more information I’d gladly try to come up with a fitting solution for you.