Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7496039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:27:04+00:00 2026-05-29T18:27:04+00:00

I wrote a simple webapp using google app engine in python that allows users

  • 0

I wrote a simple webapp using google app engine in python that allows users to upload images and have it stored somewhere (for now I’m just using the blob store based on the tutorials).

Now I want to send the images to google cloud storage, but am not sure how to do this. They provide two modes when opening a file: “a” and “r”. Neither of them, to my knowledge, are for binary streams.

How can I send an image to google cloud storage? Code snippets or references would be nice.
I am planning to send small audio samples as well, and other binary data.

Also, how can I delete the image if a user wishes to delete it? There doesn’t seem to be a delete method available.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T18:27:12+00:00Added an answer on May 29, 2026 at 6:27 pm

    Here’s a simple upload handler that will write the blob that was uploaded to bigstore. Note you will need to have added your app’s service account to the team account that is managing the bigstore bucket.

    class UploadHandler(blobstore_handlers.BlobstoreUploadHandler):
      def post(self):
        upload_files = self.get_uploads('file')
        blob_info = upload_files[0]
        in_file_name = files.blobstore.get_file_name(blob_info.key())
        infile = files.open(in_file_name)
        out_file_name = '/gs/mybucket/' + blob_info.filename
        outfile = files.gs.create(out_file_name,
                                  mime_type = blob_info.content_type)
    
        f = files.open(outfile, 'a')
        chunkSize = 1024 * 1024
        try:
          data = infile.read(chunkSize)
          while data:
            f.write(data)
            data = infile.read(chunkSize)
        finally:
          infile.close()
          f.close()
    
        files.finalize(outfile)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a simple Sinatra app that generate an image using rmagick from some
Using Django templates in Google App Engine (on Python), is it possible to compare
I'm using Google App Engine (Python), and using OpenID for login. Specifically, I'm playing
I am using python and webapp framework in app engine for backend and flex
I'm putting together a Google App Engine webapp in python and I'm seeding it
I'm writing a simple web app in PHP that needs to have write access
I wrote a simple tool to generate a DBUnit XML dataset using queries that
I store thumbnail images in Google App engine entities as BlobStoreProperties. Over time thumbnails
I'm trying to do a simple echo app using Python. I want to submit
I have built a website based on Google App Engine. It includes ten models,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.