This is the code im trying to execute
web.ctx.output doesnt work
if f['status'] == 200:
ext=''
i = imgurl.rfind('.')
if i > 0 and i < len(imgurl):
ext = imgurl[i+1:].lower()
web.header('Content-type', 'image/'+ext)
web.ctx.output=f['data']
#return f['data']
also
return f['data'] gives this error
Traceback (most recent call last):
File "/home/mark/work/common/web/wsgiserver/__init__.py", line 987,
in communicate
req.respond()
File "/home/mark/work/common/web/wsgiserver/__init__.py", line 543,
in respond
self._respond()
File "/home/mark/work/common/web/wsgiserver/__init__.py", line 555,
in _respond
response = self.wsgi_app(self.environ, self.start_response)
File "/home/mark/work/common/web/httpserver.py", line 200, in
__call__
return self.app(environ, xstart_response)
File "/home/mark/work/common/web/application.py", line 220, in wsgi
result = [utils.utf8(result)]
File "/home/mark/work/common/web/utils.py", line 224, in safestr
return safeunicode(obj).encode(encoding)
File "/home/mark/work/common/web/utils.py", line 207, in safeunicode
return obj.decode(encoding)
File "/usr/lib/python2.5/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position
5850: unexpected code byte
Please let me know how to do static file serving in webpy .3
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---