Hey guys! I know this topic is old, but here it's *working great* with 
mysql or sqlite on web2py 2.7.4.

Just install:

pip install fs

Then on model:

import fs.s3fs
myfs = fs.s3fs.S3FS(bucket, prefix, aws_access_key, aws_secret_key)
db.define_table('image',Field('image','upload',uploadfs = myfs))

I'm using ubuntu 12.04 amd64 with python 2.7.3 virtualenv.

Thx for your help!

Em sábado, 2 de junho de 2012 19h19min57s UTC-3, c h escreveu:
>
> i bet we could do something similar using the boto library on GAE.
>
> On Thursday, May 31, 2012 10:56:47 AM UTC-7, Massimo Di Pierro wrote:
>>
>> Here is an example:
>>
>> easy_install pyfilesystem
>>
>> >>> import fs.s3fs
>> >>> myfs = fs.s3fs.S3FS(bucket, prefix, aws_access_ke, aws_secret_key)
>> >>> db.define_table('test',Field('file','upload',uploadfs = myfs))
>>
>> Now all your uploaded files will go on S3.
>> Here is a list of supported filesystems: 
>> http://packages.python.org/fs/filesystems.html
>>
>> WARNINGS: 
>> - needs testing. I have tested with OSFS and I am confident it works
>> - I do not think with will work on GAE, should be tested
>> - uploadfolder and uploadseparate are ignored when uploadfs is specified 
>> (this should be changed, any takers?)
>>
>> Should be possible to wrap myfs into an encryption layer but I have not 
>> done it yet.
>>
>> We may want a more comprehensive strategy and allow every web2py file 
>> (including apps, sessions, tickets, etc) to go into a pyfilesystem. Is this 
>> necessary? On linux one can mount filesystems in a folder anyway. Is this 
>> more trouble than it is worth?
>>
>> Massimo
>>
>>
>>
>>
>>
>>

-- 
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