Search code examples
google-drive-apihostingfirebase-storagedropbox

Hosting images in Google Drive or Dropbox for app usage


I have a mood tracking app called Moodflow and I am trying to implement adding images to the app / to a users entry. I am considering using firebase storage to store the images of my premium users but I am a bit worried about saving too many images and the costs spiraling out of control.

I have seen other journaling apps using Google Drive and Dropbox as backup features (mostly just JSON data) however I am unsure how well these platforms will perform when I upload my users' images for hosting (and backup). Can I hoist images in Google Drive or Dropbox in the first place? And would this be a viable solution?

There seems to be a lot of confusion online if you can even to this or not.


Solution

  • Google Drive doesn't support image hosting such that they can be linked to directly and embedded in apps or HTML content. There is a workaround, where you can embed the image by obtaining the file ID from the Drive API, and embedding it within https://drive.google.com/uc?export=view&id=<fileId>, however for mass sharing this isn't recommended as it subject to quota usages.

    Dropbox does support image hosting and you can use the Dropbox API to get the public link to the image which is embeddable. The /shares endpoint allows you to obtain the public viewable link via the API.

    Firebase is Google's service which does support image hosting as part of the Cloud Storage service. This is also available via the API and so can be retrieved programmatically much like Dropbox. Embedding the Firebase link as the image source allows for usage in external apps and pages. This answer may be helpful for that.

    Dropbox and Firebase are both subject to pricing plans, which have different tiers depending on personal or business use, and the amount of storage you require. Firebase has a Pay-as-you-go pricing which charges you for the storage you use, which may be helpful, though it really would be down to what methods and pricing you need.

    You can see Dropbox individual pricing plans here while their business pricing plans are here. Firebase's pricing plans can be seen here. I suggest you look into both carefully so that you make the right decision for your needs.