storing blob field on s3

64 views
Skip to first unread message

Mark Graves

unread,
Sep 6, 2015, 8:44:20 PM9/6/15
to web2py-users
Hey everyone,

Quick question.

Is there a quick workaround for storing a blob db field on s3?

Would it work to set uploadfs = S3FS(bucket....)?

Or would I have to change it to an upload type field and then set the uploadfs for the uploadfield?

-Mark

Massimo Di Pierro

unread,
Sep 7, 2015, 11:38:16 PM9/7/15
to web2py-users
Sorry for the late reply:

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

which is what you suggest basically. Should work our of the box.

Mark Graves

unread,
Sep 8, 2015, 1:30:56 AM9/8/15
to web...@googlegroups.com
Right.

No worries.

What about a field of type blob?

Will that also accept an uploadfs argument and act the same way?

Or do I have to store it as an upload?

--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/VuTTC40iWwI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Massimo Di Pierro

unread,
Sep 8, 2015, 10:49:26 PM9/8/15
to web2py-users
No. Only upload type fields can go on filesystem. The others by definition go in db.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.

Natsu Ken

unread,
Feb 7, 2016, 12:32:02 AM2/7/16
to web2py-users
Hi Massimo,

I'm trying to follow the direction you mentioned, but I got 403 Forbidden Error whenever I tried to upload a file.
The fs is of version 0.5.4.
Is there any specific configuration need to be done on the S3 ?
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages