In the DB the upload field looks like this which I think could be part
of the problem:
FieldStorage('upload', 'Mars.jpg', '\xff\xd8\xff\xe0\x00\x10JFIF
\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xff\xfe\x00>CREATOR: gd-jpeg
v1.0 (using IJG JPEG v62), default quality\n\xff\xdb\x00C
\x00\x08\x06\x06\x07\x06\x05\x08\x07\x07\x07\t\t\x08\n\x0c\x14\r\x0c
\x0b\x0b\x0c\x19\x12\x13\x0f\x14\x1d\x1a\x1f\x1e\x1d\x1a\x1c\x1c $.\'
",#\x1c\x1c(7),01444\x1f\'9=82<.342\xff\xdb\x00C\x01\t\t\t\x0c\x0b\x0c
\x18\r\r\x182!\x1c!
22222222222222222222222222222222222222222222222222\xff
\xc0\x00\x11\x08\x00d\x00K\x03\x01"\x00\
The error looks like this:
Traceback (most recent call last):
File "C:\Users\Lennon\workspace\web2py_source\gluon\restricted.py",
line 186, in restricted
ccode = compile2(code,layer)
File "C:\Users\Lennon\workspace\web2py_source\gluon\restricted.py",
line 173, in compile2
return compile(code.rstrip().replace('\r\n','\n')+'\n', layer,
'exec')
File "C:\Users\Lennon\workspace\web2py_source\applications\sos_test/
views\default/trip_type.html", line 368
response.write('" alt="', escape=False)
^
SyntaxError: invalid syntax
On Jul 3, 12:50 pm, Lennon <[email protected]> wrote:
> Here is My Model
>
> db.define_table('img', timestamp,
> Field('caption','string', length=1000,
> requires=[IS_LENGTH(1000)]),
> Field('upload', 'upload', requires=[IS_LENGTH(200000)],
> uploadfolder=os.path.join(request.folder,
> 'uploads','images','general'))
> )
>
> To Display I've tried:
>
> <img src="{{=URL('download', args=img['upload']}}">
> <img src="{{=URL('default', 'download',args=img['upload']}}">
> <img src="{{=URL('default', 'download', 'images/
> general',args=img['upload']}}">
>
> But they all give me the same error: