Note, response.download gets the table and field name from the filename -- it then uses that information to find the file. If you use SQLFORM.factory to upload the file and use its default naming or create a custom name for the file, then it will not have the proper name structure for response.download to identify the db table/field and find the file. If you need to store a file manually, see http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#More-on-uploads .
Anthony On Tuesday, September 10, 2013 6:37:28 AM UTC-4, Tushar Tuteja wrote: > > I have created a form using SQLFORM.factory > > import os > form=SQLFORM.factory( > > Field('image','upload',uploadfolder=os.path.join(request.folder,'uploads/')) > ) > > I am using form.vars.image to populate a db table > the file is being uploaded with a changed name. that changed name is > populated into my db field > but when I use "{{=URL('download', args=record.image)}}" > > it gives me a 404 error > > -- 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/groups/opt_out.