On Sunday, January 14, 2018 at 4:30:57 AM UTC-5, Annet wrote: > > Thank you all for your replies, > > This works : > > table.image.uploadfolder = '/home/webapps/uploads' > > to upload the images into separate folders I made the following adjustment: > > folder = 'vertexID' + str(vertexID) > table.image.uploadfolder = os.path.join('/home/webapps/uploads/' + folder) > > > The problem is the image file doesn't display in the form: > > form = SQLFORM(table, record, deletable=True, showid=False, > upload=URL('home', 'webapps', 'uploads/' + folder, > args=request.vars.image)) >
web2py does not serve files by simply passing a filesystem path as a URL. If you are not storing the files in the application's /static folder, you must create an action within your app that serves uploaded files (see the /default/download action in the welcome app for an example) and specify the URL of that action as the "upload" argument. Anthony -- 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.