Actually, on GAE, I don't think you have to explicitly define the blob
field at all -- the DAL will automatically create a blob field for each
upload field and store uploaded files in the blob field. So, I think this
should work:
dal_db.define_table('UserImageStore',
Field('profile_image',
Sorry got confused.
Made it work !
Here is the final code :
dal_db.UserImageStore.insert(profile_image =
dal_db.UserImageStore.profile_image.store(profile_image,),
profile_blob = profile_image,
upload_ts = datetime.now(),
Will this work on AppEngine ? Since there is no filesystem
The code for manual uploads is :
stream = open(filename,'rb')
Will this not give error since it will not be able to find the file ?
On Monday, June 18, 2012 6:52:02 PM UTC+5:30, Anthony wrote:
>
> and the my show_image function is :
>>
>
> and the my show_image function is :
>
> def show_image():
> return response.download(request,dal_db)
>
That's the problem -- response.download() calls dal.Field.retrieve(), which
assumes the filename is encoded via base64.b16encode (i.e., it assumes the
file was stored using dal.Field.s
The code for the model UserImageStore is :
dal_db.define_table('UserImageStore',
Field('profile_image','upload',uploadfield='profile_blob'),
Field('profile_blob','blob'),
Field('upload_ts','datetime'),
Field('change_ts','datetime')
)
and the my show_image function is :
def show_i
What is your db.UserImageStore model, and what is the code for downloading
the image?
On Monday, June 18, 2012 7:49:58 AM UTC-4, Sushant Taneja wrote:
>
> Hi,
>
> I am building an app using AppEngine + Web2py
>
> A user's profile image is retrieved from his Facebook profile via the
> Graph API a
6 matches
Mail list logo