[web2py] How to embed uploaded PDF?

2015-12-05 Thread William Chen
Does anyone know how to embed an uploaded PDF on a page? I know the download URL given by {{=URL('download',args=row.field_name)}}, but this URL does not seem to work for embedding. For example, the URL does not work for PDFObject: function embedPDF(){ var myPDF = new PDFObject({

[web2py] Help a noob - I have run script setup-web2py-nginx-uwsgi-ubuntu.sh, now what?

2018-07-07 Thread William Chen
Hi web2py community, I am a complete noob, so bear with me. I have set up my server on DigitalOcean, set up my SSH and user permissions, and run the following script successfully: cd ~/ wget https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh chmod

[web2py] Re: reddit clone - foreign key constraint failed

2014-12-23 Thread William Chen
Hi Chris, I had the same problem and found this thread when I was searching for a solution. The solution is to simply create 1 or more comments using app admin. If table B references table A, then you need populate to populate table A before you populate table B, else there will be an error. I

[web2py] Web2py freezes when uploading a file greater than IS_LENGTH maxsize

2015-02-19 Thread William Chen
Hi all, *Background:* I have created a file upload form where you can upload any file smaller than 1MB. This is the db field for the file: Field('file1', 'upload', requires = IS_LENGTH(minsize=0, maxsize=1048576, error_message='File is too huge.')), *Problem:* When I try to upload a huge fil

[web2py] Re: Check file size before upload process

2015-03-10 Thread William Chen
I believe you can use 'onvalidation' to check the file size before upload. http://web2py.com/books/default/chapter/29/07/forms-and-validators#onvalidation -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.go