I find that if I use default = 'xxx.jpg' and the form input is left
empty, the field will have a length of 0 (not null) instead of the
defined default value.

Is this a bug?

On Feb 8, 4:51 pm, Bernardo Botella Corbí <estem...@gmail.com> wrote:
> Hi Massimo,
>
> I'm trying it, but maybe I am doing something wrong.
>
> in the model I have this:
> Field('imagen', 'upload',
> default='auth_user.imagen.a9ea07ced8e92070.56657370615f4c58565f323030375f31 
> 315f31303234783736382e6a7067.jpg'),
>
> being that jpg file an upload file inside the upload folder. If I leave the
> upload field blank at the form, in database imagen appears with None value.
> Am I doing anything wrong?
>
> thanks a lot,
> Bernardo
>
> 2011/2/7 Massimo Di Pierro <massimo.dipie...@gmail.com>
>
>
>
>
>
>
>
> > If you have an uploaded file (with name given by web2py) you can set
> > default='....' its filename without path.
> > Did you try it?
>
> > On Feb 7, 1:40 pm, Bernardo <estem...@gmail.com> wrote:
> > > Dear all,
>
> > > is there a way to use a default file in an upload field? Something
> > > like:
>
> > > Field('whatever', 'upload', 'default=...')
>
> > > Which one is the best way to do this?
>
> > > thanks a lot for your help,
> > > Bernardo

Reply via email to