[web2py] Re: Crappy downloaded image names

2012-06-18 Thread Anthony
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',

[web2py] Re: Crappy downloaded image names

2012-06-18 Thread Sushant Taneja
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(),

[web2py] Re: Crappy downloaded image names

2012-06-18 Thread Sushant Taneja
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 : >>

[web2py] Re: Crappy downloaded image names

2012-06-18 Thread Anthony
> > 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

[web2py] Re: Crappy downloaded image names

2012-06-18 Thread Sushant Taneja
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

[web2py] Re: Crappy downloaded image names

2012-06-18 Thread Anthony
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