Sunday, October 4, 2015

Hosting for your files instead of Google Drive (Google Storage)

A lot of not only Google Apps Script developers and users have used Google Drive feature to host any file as webhosting. It was useful for CSS files, images, JavaScript libraries, which can be used in code. Deployment was very easy - you have just copied files into specific folder and change sharing options.

Google recently announced, that hosting feature will be deprecated (more information here). Users have, according to deprecation policy, one year to find out a new place where to store files.

I was thinking about several options, so I would like to bring some alternatives.

The first one is Google Storage, which is a part of Google Cloud platform



Google Storage allows you to host any file with advanced possibilities like control who can read/write, monitor of traffic etc.

The main advantage is connection with App Script. Every Apps Script project has also Cloud project in Developers console (http://console.developers.google.com)

From Google Apps Script editor choose Resources --> Advanced Google services



In the new window, click at link "These services must also be enabled in the Google Developers Console."

In Developer console,  select Storage - Cloud storage. If you open console for the first time, you have to click button Enable billing (In this section you will fill in credentials like your name or number of credit card)


Now it is time to Create a bucket. Have you ever heard about it? The bucket is virtual space, where your objects (files) are stored. You can have serveral buckets for one Cloud project


Select name of the bucket. Important - this name must be unique in all Google Cloud Storage platform



Now you can create a new folder inside the bucket and upload files - by clicking button or drag'n'drop like in Google Drives. It is similar, isn't it ?


The last thing is publish on the web by click on checkbox


The final URI will like:

https://storage.googleapis.com/BUCKET/FOLDER/load.gif
Now you can insert your file in your Apps Script HTMLService code or send link to someone else.


Google Storage is a paid service, but the price is low and according to using of service (=cloud).There are three main questions for you
  1. How much data do you need to store ? (1GB per month = $0.026)
  2. How many requests do you do? (10 000 requests for $0.01)
  3. What is total traffic through your bucket ( 1GB of traffic in EMEA/AMERICA= $0.12)

So if you are planning to host 10 MB ($0.01) with total loading 100 000x ($0.01) and traffic 1GB ($0.12), you will finally get receipt $0.14 for month!

Google prepared online tool to get information about price: https://cloud.google.com/products/calculator/

Conclusion
I am just starting use this way to host files, but I have already recognize "best pattern". Its looks like, that is better to create one main project in Developer Console, which wont be connected to any GAS  project. Then for every GAS project create a new bucket.. 



Are you interested in this topic? Follow me on Twitter, Google+ or subscribe RSS

18 comments:

  1. J'ai commandé une montre Rolex Replica ici. La montre rolex que j'ai reçue était une maçonnerie parfaite et éblouissante. Très satisfait de l'achat.
    fausses rolex montres
    copier des montres rolex

    ReplyDelete
  2. Lever een verscheidenheid aan replica-horloges, waaronder Breitling, Omega, Cartier, Tag Heuer, Associated Press en andere luxe replica-horloges.Replica watchesReplica watches

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. I would point out that we website visitors actually are unequivocally lucky to exist in a useful website with so many wonderful people with very helpful concepts. hospedaje web revendedor

    ReplyDelete
  5. I am hoping the same best effort from you in the future as well. In fact your creative writing skills has inspired me. Learn more

    ReplyDelete
  6. This particular papers fabulous, and My spouse and i enjoy each of the perform that you have placed into this. I’m sure that you will be making a really useful place. I has been additionally pleased. Good perform! hosting chile

    ReplyDelete
  7. Thanks a lot for sharing us about this update. Hope you will not get tired on making posts as informative as this. clicca qui

    ReplyDelete
  8. The first phase the preparation should, theoretically, be uninfluenced by the intended intensity and duration of the sound which is subsequently produced. In fact, however, so quickly are the three phases accomplished that the pianist rarely has capacity to think, in performance, of each phase separately. hostgator coupon 1 cent

    ReplyDelete
  9. Mmm.. good to be here in your article or post, whatever, I think I should also work hard for my own website like I see some good and updated working in your site. visit website

    ReplyDelete
  10. Great article with excellent idea!Thank you for such a valuable article. I really appreciate for this great information.. https://privacyonline.com.br

    ReplyDelete
  11. you can always buy cheap foods on any supermarket these days because food production is mechanized already,. Domain Registration

    ReplyDelete
  12. I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement the concept. Thank you for the post. www.lemigliorivpn.com

    ReplyDelete
  13. I like this site very much, Its a really nice situation to read and get info . web designer in islamabad

    ReplyDelete
  14. Thanks for this post. I definitely agree with what you are saying. I have been talking about this subject a lot lately with my brother so hopefully this will get him to see my point of view. certificado ssl

    ReplyDelete
  15. Pretty part of content. I just stumbled upon your weblog and in accession capital to assert that I get actually loved account your weblog posts. Any way I’ll be subscribing on your feeds or even I success you access constantly fast. Web developer service

    ReplyDelete
  16. realy thanks for starting this up. this website is something that’s wanted on the web, somebody with a little bit originality
    SEO Expert in Multan

    ReplyDelete
  17. Advantageously, typically the submit is really the very best about this laudable theme. To be sure with all your a conclusion and will thirstily await the following revisions. Really stating cheers won’t only end up being suitable, to your good readability within your creating. I may at once seize a person’s rss to sleep in abreast of virtually any upgrades. Fine job and much success within your organization business! Web Server Security Testing

    ReplyDelete
  18. Wonderful beat ! I would like to apprentice whilst you amend your web site, how can i subscribe for a blog website? The account helped me a applicable deal. I had been tiny bit acquainted of this your broadcast provided shiny transparent idea. Bluehost Coupon Code:Get Upto 80% Off +FREE Domain+FREE SSL

    ReplyDelete