In the cms application uploads folder I made this directory:
company_443
In the function that contains the upload field I set:
db.outerimage.image.uploadfolder=os.path.join(request.folder,"uploads/
company_%i" %auth.user.bedrijf_id)
When I expose the function and upload an image it ends up in the ../
upload/company_443 directory. Which is the intended behaviour.
In the init application's view in which I want to display the uploaded
images, I set the image's src attribute to:
{{=IMG(_src=URL(r=request,a='cms',c='default',f='download/company_' +
str(club[0].id), args=image_1[0].image))}}
When I expose the related function the scr attribute reads like:
<img scr="/cms/default/download/company_443/outerimage.image.880xxxx
However, the image isn't displayed, I guess this has something to do
with the download functions implementation. Is there a way to solve
this or is it simply impossible to exchange uploaded files between
applications?
The fact that /[app]/ is mentioned in the download function made me
think it would be possible to define an app other than the one
containing the download function.
def download():
"""
allows downloading of uploaded files
http://..../[app]/default/download/[filename]
"""
return response.download(request,db)
Kind regards,
Annet.