Thanks Nick

I think I'll go the entity.BlobProperty route since I have more
control that way.

One more question, how do I get the filename/extension, content_type,
height and width of the image being uploaded?

I am using bits=self.request.get('file') to get the file content from
an input-type-file and storing it with db.Blob(bits) which is working
fine. Testing with jpegs now works fine, but I'd like to determine
more image properties in order to let the handler take care also of
pngs and gifs.

If I use the Images API I can get height and width, but no
content_type or filename.

Ideas?

On Aug 12, 12:23 pm, "Nick Johnson (Google)" <[email protected]>
wrote:
> Hi,
>
> On Wed, Aug 11, 2010 at 8:49 PM, Backpack <[email protected]> wrote:
> > I am going to store images in my app, so I'd like to know which is the
> > preferred way both in performance and quota/cost: blobstore or
> > blobproperty?
>
> Both use equivalent amounts of quota. Blobstore is designed for storing and
> serving large files to users, while the datastore's BlobProperty is better
> suited for smaller values. If your files are less than 1MB, but they still
> fit the blobstore use case, it's up to you - pick whichever is most
> convenient.
>
>
>
> > Size will never be over 1MB and I don't think I'll exceed 1GB per day.
>
> The free storage quota is 1GB of storage - not 1GB per day!
>
>
>
> > - I could use an Image entity to store them all.
> > - I could use a property of an entity, like avatar per user.
> > - I could use the blobstore and serve everything from there.
>
> > Also would like to know about image caching using either method.
>
> You can cache responses using a BlobProperty, but you can't cache the
> blobstore response yourself - you have to leave it up to Blobstore to do
> that, or not as it chooses.
>
>
>
> > One last question, if we go the blobstore route, how to change the
> > key_name before or after inserting the image in the blobstore?
>
> The blob key is determined by the blobstore. If you want to address it by
> another name, you need to store a BlobReferenceProperty in the datastore.
>
> -Nick Johnson
>
>
>
> > Thanks in advance.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-appengine%2Bunsubscrib 
> > [email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine?hl=en.
>
> --
> Nick Johnson, Developer Programs Engineer, App Engine Google Ireland Ltd. ::
> Registered in Dublin, Ireland, Registration Number: 368047
> Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
> 368047

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to