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 8291541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:09:51+00:00 2026-06-08T13:09:51+00:00

I have a question about serving/rendering an image saved in the blobstore I get

  • 0

I have a question about serving/rendering an image saved in the blobstore

I get a 404 error
It seems to find the url?? http://clockinapple.appspot.com/serve/AMIfv97XybVYJy5Jk1e7WCSfCc-IO7zBtlVaC8ef8-Im /etc/

The code is basically the same as the example – any help greatly appreciated

This is my handler code:

class ServeHandler(blobstore_handlers.BlobstoreDownloadHandler):
    def get(self, resource):
        resource = unicode(str(urllib.unquote(resource)))
        blob_info = blobstore.BlobInfo.get(resource)
        self.send_blob(blob_info)


class GetBlobstoreUrl(BaseHandler):
    def get(self):
        upload_url = blobstore.create_upload_url('/upload/')
        self.response.out.write(upload_url)

class UploadHandler(blobstore_handlers.BlobstoreUploadHandler):
    def post(self):
        upload_files = self.get_uploads('file')
        blob_info = upload_files[0]
        user_info = blobstore.BlobInfo.all().get().filename
        text = user_info
        head, sep, tail = text.partition('.')
        user_info = head
        photo = clockin.UserPhoto(blob_key=blob_info.key(), employee=user_info)
        photo.put()

class GetLogs(BaseHandler):
    def get(self):
        logs = clockin.UserPhoto.all() 
        params = {'logs': logs}

        return self.render_template('logs.html', **params)

This is my model code:

class UserPhoto(db.Model):
    employee = db.StringProperty(db.Key)
    blob_key = blobstore.BlobReferenceProperty()
    create_timestamp = db.DateTimeProperty(auto_now_add=True)
    update_timestamp = db.DateTimeProperty(auto_now=True)

My routes:

RedirectRoute('/serve/([^/]+)?', ServeHandler, name='serve_handler', strict_slash=True),
RedirectRoute('/logs/', GetLogs, name='get_logs', strict_slash=True),
RedirectRoute('/get_blobstore_url/', GetBlobstoreUrl, name='get_blobstore_url',   strict_slash=True),

How I serve the html: (us is the instance)

<td><img src='/serve/{{us.blob_key.key()}}'></img></td>
  • 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-06-08T13:09:53+00:00Added an answer on June 8, 2026 at 1:09 pm

    I queried the blobstore directly and the images displayed correctly
    I hope this can help someone
    My handler:

    class PicDownload(BaseHandler):
        def get(self):
            emps = clockin.Employee.all().fetch(100)
            ekey = self.request.GET.get("select1")
            ekey = str(ekey)
            afile = [] 
            blob_info = blobstore.BlobInfo.all().filter('filename =', ekey+'.jpg').order('-  creation').fetch(20)
            for a in blob_info:
            afile.append(get_serving_url(a))
    
            form = 'get_pics.html'
    
            params = {'blob_info': blob_info,
                      'afile': afile,
                      }
    
            return self.render_template(form, **params)
    

    On the HTML side:

    <select id="select1" name='select1' onchange='this.form.submit()'>
    {% for e in emps %}
        <option value={{e.key()}} ><href a=/pic_download/{{e.key()}}>{{e.username}}
        </href>    
        </option>
    {% endfor %}
    </select>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have question about why should we use return in get,if dont use what
I have question about 301 Redirect please: example: http://stackapp.com/post/35642 to: http://google.com/posts/index.php?q=http://stackapp.com/post/35642 Note: I want
I have question about regexp in TCL. How i can find and change some
I have question about parsing in Html helper : I have sth like: @foreach
I have question about clean thory in Python. When: @decorator_func def func(bla, alba): pass
I have question about XSLT1.0. The task is to write out in HTML all
I have question about normalization. Suppose I have an applications dealing with songs. First
I have question about interpreting strings as packed binary data in C++. In python,
i have question about YAJLiOS parser... I have next json data : {{ body
I have a question about this formula from a book: EFW (cm,kg)= 10^(-1,7492+(0,166*BPD)+(0,046*AC)-(2,646*AC*BPD/1000)) The

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.