Like this??

db.define_table('configfiles'
    Field('cfgfile','upload'))

def getfiles():

    form= SQLFORM(db.configfiles)

    if form.accepts(request.vars):

db.configfiles.insert(cfgfile=db.configfiles.cfgfile.store(request.vars.Filedata.file,
request.vars.Filedata.filename))

    return dict(form=form)

On Tue, Jul 26, 2011 at 4:15 PM, Bruno Rocha <rochacbr...@gmail.com> wrote:

> I did it with forms. Client needs to make a POST to web2py with input file
> in form (make sure the right content type)
>
> in web2py server create an action that does:
>
> example:
>
> #model
> Field('picture','upload',uploadfolder=request.folder+'static/uploads',
> autodelete=True )
>
> #receiver
> in form.accepts():
> db.table.insert(picture=db.photo.picture.store(request.vars.Filedata.file,
> request.vars.Filedata.filename))
>
>
>
> On Tue, Jul 26, 2011 at 6:01 PM, Ismael Serratos 
> <ialejandr...@gmail.com>wrote:
>
>> Hi! I was wondering how could I upload a file to web2py from another PC
>> (intranet app) but via http, I mean, make a server and a client script.
>>
>> Is it possible??
>>
>> client does't have web2py, just python, server is running web2py.
>>
>
>
>
> --
>
>
>
> --
> Bruno Rocha
> [ About me: http://zerp.ly/rochacbruno ]
> [ Aprenda a programar: http://CursoDePython.com.br ]
> [ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
> [ Consultoria em desenvolvimento web: http://www.blouweb.com ]
>
>

Reply via email to