Apparently problem solved and not Web2py related. I needed to use open(path, 'rb').read() and encodestring instead of trying to encode the file directly. Thank you for responding.
On Friday, July 24, 2015 at 3:58:00 PM UTC-5, Massimo Di Pierro wrote: > > before we answer that question. What are you trying to do? > > On Wednesday, 22 July 2015 01:34:05 UTC-5, Phillip wrote: >> >> In the controller in a json service function, I download a stored file of >> type 'upload' as follows: >> >> filecontents = URL('download', args=db.s_files[1].s_file) >> >> encoded = base64.b64encode(filecontents) >> >> return encoded >> >> Is this the right way to encode stored files? I am expecting a much >> larger encoded string >> >> Thank you >> > -- 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.