aldryn-forms icon indicating copy to clipboard operation
aldryn-forms copied to clipboard

Unprotected submitted files and pictures in filer_public - make use of diavo/django-filer

Open FSE-DEV opened this issue 9 years ago • 3 comments
trafficstars

Currently all files and pictures transmitted through aldryn-forms are stored somewhere within the media/filer_public folder, thus available unprotected to the public / everyone who knows or guesses the randomly created link.

Since django-filer is a requirement of aldryn-forms already and already capable of protecting files, I strongly suggest to make both add-ons collaborate to their full potential.

When installing the aldryn-forms add-on or even better at the individual form level, a choice should be given to have the submitted data protected from public access, i.e. accessible only when logged-in - this is crucial for many use cases with critical data!

FSE-DEV avatar Jul 29 '16 22:07 FSE-DEV

@stefanfoulis IIRC @Chive mentioned once that he addressed this issue by using a custom bucket via django-storages.

jmelett avatar Aug 03 '16 13:08 jmelett

Yes, it's quite easily achievable in general:

First, install and configure https://github.com/etianen/django-s3-storage. Then:

# initialize the storage
from django_s3_storage.storage import S3Storage
safe_storage = S3Storage()

# use it in your model
class MyModel(BaseModel):
    uploaded_file = models.FileField(
        _('Uploaded File'),
        blank=True, null=True,
        storage=safe_storage,
        upload_to='uploads'
    )

I'm unsure about this is best integrated with aldryn-forms though :-)

Chive avatar Aug 04 '16 07:08 Chive

Agreed, filer already has public/private file handling (or at least a branch once did). Best would be to reuse that.

czpython avatar Aug 04 '16 11:08 czpython