← Writings

Upload more than 100 files to Cloudlfare R2 using Filezilla

24 Apr, 2023

Cloudflare dashboard (and most other S3-compatible services) has a hard limit on how many files you can upload to S3 using the dashboard. For Cloudflare's R2 service, you can only upload 100 files through the dashboard. Anything more than that and you get the following error:

"You can only upload up to 100 files from the dashboard. Use the Wrangler CLI or API to upload more files."

Now, you could setup Wrangler CLI and upload it that way. But trust me, that's a pain in the ass. Not only is the documentation on it not great, you'll waste time if this is a one-off thing (like migrating to R2 for the first time). A simpler/faster way to upload an unlimited number of files is to use an S3 client and guess what, Filezilla supports custom S3 endpoints.

So here's a quick guide on how to setup R2 on Filezilla so you can upload how many ever files you want.

  1. Open up Filezilla and open the app's settings (Command + , on Macs)
  2. Open the S3 providers section
  3. Click the Add button for providers and name it R2 or something like that
  4. Click the Add button for regions and name it the same thing as the region you setup your bucket in (usually it's auto, but you might have selected a specific one. You can see their complete list of regions here - https://developers.cloudflare.com/r2/buckets/data-location/) As of this writing, there are only the following options for regions - auto, wnam, enam, weur, eeur, apac. Pick the one you picked when setting up R2.
  5. For the endpoint, go to your bucket settings and copy the URL for S3 API. However, remove the "https://" part, the bucket name, and any trailing slashes. So if your S3 API endpoint was "https://fdsfdsfsdfsdfsdfsdfsdfsdfsdfef23r3r3.r2.cloudflarestorage.com/bucketname/" then use the following value in the endpoint section of Filezilla "fdsfdsfsdfsdfsdfsdfsdfsdfsdfef23r3r3.r2.cloudflarestorage.com"
  6. Now save it. Then add a new connection to your Filezilla Site Manager
  7. Set the connection type as S3 - Amazon Simple Storage Service
  8. Set the host as the same thing as the S3 API above for providers.
  9. Logon type as Normal
  10. For the credentials, create an API token in the R2 console using the "Manage R2 API Tokens" link in the console.
  11. Once the token is created, use the Access Key ID (from the R2 console) as the Access key ID (in Filezilla), and the Access Key Secret (from the R2 console) as the Secret Access Key (in Filezilla).
  12. Done, just confirm the SSL cert is valid and verified, and then connect. Hopefully all goes well and I've provided all the instructions 😅