Have you tried:

db.img_logo.image.uploadfolder = os.path.join(request.env.
applications_parent,
                                              'applications', 'my', 
'uploads', folder)

Anthony

On Tuesday, October 14, 2014 1:29:39 PM UTC-4, Annet wrote:
>
> I web2py/applications I have 3 applications 1 application 'dbmodel' that 
> contains the .table files in the databases folder
> and static files in the static folder, 1 application 'my' that serves as a 
> backend and 1 application 'init' that serves as
> a frontend.
>
> As a way to reduce memory usage webfaction recommends a symbolic link to a 
> static-only application which serves the 
> contents from the static folder of my application 'dbmodel'.
>
> I have the following table definition:
>
> db.define_table('img_logo',
>     Field('nodeID', 'reference nd_node', ),
>     Field('imageFilename', length=128, writable=False, readable=False),
>     Field('image', type='upload', requires=[IS_IMAGE(extensions=('gif', 
> 'jpg', 'jpeg', 'png'), maxsize=(256, 128), error_message='Afmeting: 
> maxWidth is 256 pixels maxHeight is 128 pixels. File format: gif, jpg, 
> jpeg, png'), IS_LENGTH(32*1024, error_message='File size overschreidt 32 
> KB')], label='Logo * ', autodelete=True),
>     migrate = False)
>
> In the backend application I have a function which lets the user can 
> upload a logo file. In the function I have the following
> settings:
>
> folder = 'nodeID' + str(nodeID)
>  db.img_logo.image.uploadfolder = os.path.join(request.folder, 
> 'uploads/%s' %folder)
>
> To do what Webfaction recommends I wonder whether it is possible to upload 
> the logo file to:
>
> /applications/dbmodel/static/uploads/foldername
>
> instead of:
>
> /applications/my/uploads/foldername
>
>
> Kind regards,
>
> Annet
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to