[web2py] Re: Get image from url and save in uploads folder - AttributeError

2016-07-18 Thread Anthony
You cannot pass a URL to the open() function -- you must use something like urllib2 or the requests library to retrieve data from a URL. Anthony On Monday, July 18, 2016 at 10:43:54 AM UTC-4, Daniel wrote: > > Hi guys thanks again for your help. So I am using a stream object as > outlined in th

[web2py] Re: Get image from url and save in uploads folder - AttributeError

2016-07-18 Thread Daniel
Hi guys thanks again for your help. So I am using a stream object as outlined in the book, however its throwing 'no such file or directory'. But when I go to the url there is a jpg file attached. I thought it could be because the url does not end with the file extension, however I tried a diffe

[web2py] Re: Get image from url and save in uploads folder - AttributeError

2016-07-17 Thread Anthony
Also, do not handle uploads by manually creating the file and filename, as that will result in problems when retrieving (the DAL assumes the original filename is encoded in the new filename, but you have not done that). Instead, see http://web2py.com/books/default/chapter/29/06/the-database-abs