Upload field

53 katselukertaa
Siirry ensimmäiseen lukemattomaan viestiin

Kenneth Lundström

lukematon,
11.1.2011 klo 6.00.3911.1.2011
vastaanottaja web...@googlegroups.com
I�m trying to find out how form.accepts handles the uploading of files
(for my mail gateway) and made a form

form=SQLFORM.factory(Field('text','string'),
Field('upload','upload'))

When I submit a form I get a ticket stating
"you must specify a Field(...,uploadfolder=...)"

how come? In the manual it says:

These are the default values of a Field constructor:

Field(name, 'string', length=None, default=None,
required=False, requires='<default>',
ondelete='CASCADE', notnull=False, unique=False,
uploadfield=True, widget=None, label=None, comment=None,
writable=True, readable=True, update=None, authorize=None,
autodelete=False, represent=None, compute=None,
uploadfolder=os.path.join(request.folder,'uploads'),
uploadseparate=None)

I understand that if I don�t give a uploadfolder it uses a default value
of "os.path.join(request.folder,'uploads')"


Kenneth

Richard Vézina

lukematon,
11.1.2011 klo 9.20.5911.1.2011
vastaanottaja web...@googlegroups.com
You need a upload field to store the path and a field to store the name of the file... The book is not clear I think about upload particularly about blob storage...

My model :

Field('chroma','upload',uploadfield='chroma_blob'),
Field('chroma_blob','blob'),

You need both doen't matter if you use blob. 

Hope this help!

Richard

2011/1/11 Kenneth Lundström <kenneth.t...@gmail.com>
I惴 trying to find out how form.accepts handles the uploading of files (for my mail gateway) and made a form


   form=SQLFORM.factory(Field('text','string'),
                        Field('upload','upload'))

When I submit a form I get a ticket stating
"you must specify a Field(...,uploadfolder=...)"

how come? In the manual it says:

These are the default values of a Field constructor:

Field(name, 'string', length=None, default=None,
     required=False, requires='<default>',
     ondelete='CASCADE', notnull=False, unique=False,
     uploadfield=True, widget=None, label=None, comment=None,
     writable=True, readable=True, update=None, authorize=None,
     autodelete=False, represent=None, compute=None,
     uploadfolder=os.path.join(request.folder,'uploads'),
     uploadseparate=None)

I understand that if I don愒 give a uploadfolder it uses a default value of "os.path.join(request.folder,'uploads')"


Kenneth


Massimo Di Pierro

lukematon,
15.1.2011 klo 6.04.1815.1.2011
vastaanottaja web2py-users
Is there an oen issue here? I do no see a problem.

On 11 tammi, 08:20, Richard Vézina <ml.richard.vez...@gmail.com>
wrote:
> You need a upload field to store the path and a field to store the name of
> the file... The book is not clear I think about upload particularly about
> blob storage...
>
> My model :
>
> Field('chroma','upload',uploadfield='chroma_blob'),
> Field('chroma_blob','blob'),
>
> You need both doen't matter if you use blob.
>
> Hope this help!
>
> Richard
>
> 2011/1/11 Kenneth Lundström <kenneth.t.lundst...@gmail.com>

Arun K.Rajeevan

lukematon,
15.1.2011 klo 12.47.0015.1.2011
vastaanottaja web...@googlegroups.com
No, blob is optional, and it'll work well without specifying a blob field. (I use only upload and it works on GAE too)

Arun K.Rajeevan

lukematon,
15.1.2011 klo 12.50.0215.1.2011
vastaanottaja web...@googlegroups.com
Are you trying to do manual upload?
I remember I got such an error a while back.  Can't recall exactly what happened that time. I'll let you know if I can recall. (My Hg repo., of that project is lost due to hdd malfunction :( )

Kenneth Lundström

lukematon,
16.1.2011 klo 4.11.2116.1.2011
vastaanottaja web...@googlegroups.com
Yes I was trying to understand how the manual uploading was working,
never got it working, but I solved the issue an other way so did not put
any more time on it.


Kenneth

Vastaa kaikille
Vastaa kirjoittajalle
Välitä
0 uutta viestiä