Can use Amazon S3 to store image


Hi Team,
Google storage can not be reached in China. I would like to host own farmweb. Is there a way to switch to other storage? like AWS S3 or Aliyun ,



This is probably possible, but I have never used Aliyun, so my ability to help you is limited. It would requiring changing the codebase in one of the following ways:

  1. Find an AWS compatible vendor that is usable in China and change the codebase to use that instead. Many vendors, like Google Cloud Storage and Digital Ocean Spaces offer storage APIs that are exactly the same as Amazon AWS. This means that in most cases, you can use Google Cloud Storage, Amazon S3, or DigitalOcean Spaces interchangeably. The API is the same, you just need to change the URL that the server uses (:point_left:) . I do not know if Aliyun offers an S3 compatible service, and can’t provide much detail beyond that.
  2. Use fog-aliyun instead of fog-google. We use the Fog and Paperclip libraries for image management. Fog has many plugins, such as fog-aliyun. Again, I can’t say much there other than you would need to remove fog-google from the project, replace it with fog-aliyun and uppdate this configuration object to use Aliyun instead of Google. You might also need to update code in this controller action.

Please let me know if you try that approach, it is one that I am sure many other Chinese users would benefit from. If you are able to cleanly substitute Aliyun, we might be able to add simplified support in a future version. This change would require a minor-to-moderate amount of changes to the image handling code.


You are right and I prefer that you use digitalOcean as I am also using it for some of my projects although I am not using the conventional digitalOcean instance and instead, I am using the managed DigitalOcean server which is powered by Cloudways. But, keeping this aside I do think that digitalOcean provides an excellent uptime as well due to it’s worldwide data centers.


thanks for the information