db.mytable.insert(image=db.mytable.image.store(request.vars.image.file,
request.vars.image.filename), image_blob = request.vars.image.file.read())
this should work,
ref
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#More-on-uploads
<<
Note, if the file is to
hi, have you guys solved this problem?
Because now I'm in the same problem >_<
On Sunday, December 26, 2010 4:15:54 AM UTC+8, mdipierro wrote:
>
> Email me your app.
>
> On Dec 25, 2:08 pm, "Arun K.Rajeevan" wrote:
> > https://groups.google.com/d/msg/web2py/UtBmAdvY7E0/QQ5rBVM4lEIJ
> >
>
tried to upload to appspot.
on admin panel, I tried to view record I just inserted.
id=53018 118005 pictures.image.979a10271e1b65a7.6c7563696665722d2e6a7067.jpg
0.0 [118014L]
It shows, image field is populated, but blob field is null.
(thought, it may be helpful to debug )
It's on the way :)
Thank you for your precious time.
Email me your app.
On Dec 25, 2:08 pm, "Arun K.Rajeevan" wrote:
> https://groups.google.com/d/msg/web2py/UtBmAdvY7E0/QQ5rBVM4lEIJ
>
> tables are given in that post.
>
> But, as I point out last, problem may be in conversion of file into blob and
> getting it back.
> BTW, if you can suggest a solu
https://groups.google.com/d/msg/web2py/UtBmAdvY7E0/QQ5rBVM4lEIJ
tables are given in that post.
But, as I point out last, problem may be in conversion of file into blob and
getting it back.
BTW, if you can suggest a solution discussed in above link that will be
great; although this problem is am
Arun, we cannot continue like this. I need to see the entire model and
actions that do upload/download.
Perhaps something is wrong with web2py but you are not providing a way
to reproduce the problem.
Massimo
On Dec 25, 1:59 pm, "Arun K.Rajeevan" wrote:
> I changed
> image =
> db.pictures.imag
I changed
image =
db.pictures.image.store(form.vars.image.file, form.vars.image.filename)
to
image = db.pictures.image.store(request.vars.image.file)
for above post.
Now I changed them back. (ie correct thing)
Now there's no error in console.
But image is not showing up.
And I tried to
Arun, did you read this?
On Dec 25, 1:18 pm, mdipierro wrote:
> Actually... this is correct
>
> image = db.pictures.image.store(form.vars.image.file,
> form.vars.image.filename)
>
> this is not correct (my mistake)
>
> image = db.pictures.image.store(request.vars.image.file)
>
> but this is c
Updated from trunk.
run again.
Still GAE shows error. Now page is not rendering at all. (before page showed
without image)
ERROR2010-12-26 06:08:42,649 restricted.py:151] Traceback (most recent
call last): File
"/media/KRA/Evolve/Work/web2py_src_downloaded/google_appengine/Test/gluon/rest
Actually... this is correct
image = db.pictures.image.store(form.vars.image.file,
form.vars.image.filename)
this is not correct (my mistake)
image = db.pictures.image.store(request.vars.image.file)
but this is correct again because the file object carries a filename
image = db.pictures.i
I'm going to check trunk, but I'm curious to know the difference b/n
image = db.pictures.image.store(form.vars.image.file,
form.vars.image.filename)
and
image = db.pictures.image.store(request.vars.image.file)
first one has two arguments and later has only one.( so, file name is not
mandatory?)
Please show he entire action.
On Dec 25, 1:11 pm, "Arun K.Rajeevan" wrote:
> This worked with web2py alone, but through GAE following error occured
>
> ERROR 2010-12-26 05:35:43,554 restricted.py:151] Traceback (most recent
> call last):
> File
> "/media/KRA/Evolve/Work/web2py_src_downloaded
This worked with web2py alone, but through GAE following error occured
ERROR2010-12-26 05:35:43,554 restricted.py:151] Traceback (most recent
call last):
File
"/media/KRA/Evolve/Work/web2py_src_downloaded/google_appengine/visuallingua/gluon/restricted.py",
line 188, in restricted
exe
I understand now. I think the problem is that the field was added
later and there are record that contain None instead of ''. I fixed
this in trunk, please check it.
massimo
On Dec 25, 1:02 pm, "Arun K.Rajeevan" wrote:
> As I said, Insert seems working. since, form.accepts work.
> Error occurs,
As I said, Insert seems working. since, form.accepts work.
Error occurs, when I'm trying to retrieve it.
url = URL(r=request, f='download', args=[item.image])
IMG(_src=url, _width='150px', _height='125px')
this is how I shows picture on page.
When run through GAE it doesn't shows picture. (it w
this:
id = db.pictures.insert(image =
db.pictures.image.store(request.vars.image),words=[id], entry_by=who)
should be
id = db.pictures.insert(image =
db.pictures.image.store(request.vars.image.file),words=[id],
entry_by=who)
On Dec 25, 12:00 pm, "Arun K.Rajeevan" wrote:
> db.mytable.insert(ima
So it works now?
On Dec 25, 12:35 pm, "Arun K.Rajeevan" wrote:
> Oh, silly me.
> It took me some time to go through dal.py and realize I made a mistake by
> running above commands in web2py shell.
>
> There db.adapter will be SQLite and I've problem with gae.
>
> Now, here is the actual result.
>
Oh, silly me.
It took me some time to go through dal.py and realize I made a mistake by
running above commands in web2py shell.
There db.adapter will be SQLite and I've problem with gae.
Now, here is the actual result.
print db.pictures.fields()
* ['id', 'image', 'words', 'rating', 'entry_by',
web2py Shell Version 1.91.4 (2010-12-24 10:54:48)In[0]:
print db.pictures.fields()
Out[0]:
['id', 'image', 'words', 'rating', 'entry_by']
In[1]:
print db.pictures.image.uploadfield
Out[1]:
True
In[2]:
print db._adapter.uploads_in_blob
Out[2]:
False
Strange. Can you plese
print db.pictures.fields()
print db.pictures.image.uploadfield
print db._adapter.uploads_in_blob
what's the output?
In gluon/dal.py there is this line:
if db and self._db._adapter.uploads_in_blob==True or
for field in fields:
if isins
db.mytable.insert(image=db.mytable.image.store(request.vars.image))
will not work
-
Traceback (most recent call last):
File
"/media/KRA/Evolve/Work/web2py
restlessly trying again and again
db.pictures.insert(image = db.pictures.image.store(form.vars.image.file,
form.vars.image.filename)
worked fine while I'm running web2py stand alone.
But as soon as I try to run it through GAE, it cause error.
INSERT seems working, except, file is stored some un
If you make a form with FROM(...INPUT()) the form has not
knowledge of DB and form.accepts will not perform any db-io BUT you
can do
form=FORM(INPUT(_name='image',_id='image', _type='file'),...)
if form.accepts():
db.mytable.insert(image=db.mytable.image.store(request.vars.image))
On
24 matches
Mail list logo