Hi,
I got a slightly modified download function:
def fast_download():
   session.forget(response)
   cache.action(time_expire=604800)(lambda: 0)()
   # very basic security (only allow fast_download on 
your_table.upload_field):
   if not request.args(0).startswith("Images."):
       return download()
...
   filename = os.path.join(request.folder,'uploads',request.args(0))
   #response.headers['Last-Modified'] = time.strftime("%a, %d %b %Y 
%H:%M:%S +0000", time.localtime(os.path.getmtime(filename)))
   return response.stream(open(filename,'rb'))

my problem is that I get quite a few attempts to get to the images directly 
like: /default/fast_download/Images.thumb.bb2649....jpg etc.
39 since yesterday. which raises an error. The User Agent claims to be the 
GoogleImageBot at least most of the times.
I did put this line in the robots.txt: 

Disallow: /default/fast_download/
but it seems to have no effect at all.
Any ideas on the strategies I should use when the function is called directly?

-- 
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/groups/opt_out.

Reply via email to