bocca
bocca

Reputation: 1995

Django Zip upload permission problem

I have few uploads in this app, uploading csv files is working fine.

I have a model that has zip upload in it. Zip file is uploaded, can be viewed, but having issues extracting it.

class Message(models.Model):
    uploadFile = models.FileField(_('images file (.zip)'),
                                    upload_to='message/',
                                    storage=FileSystemStorage(),
                                    help_text=_(''))

The error is

IOError at /backend/media/new

(13, 'Permission denied')

Upvotes: 0

Views: 763

Answers (2)

bocca
bocca

Reputation: 1995

it works with ZipFile.extractall

Upvotes: 0

Bartek
Bartek

Reputation: 15609

It's not really an issue with the zip file, it's probably an issue with your directory's permissions.

Take a look at the permissions for /backend/media/new. Is new a folder being created by the zip or is that where you're trying to unzip too? Make sure the groups for the folders also match.

Here's a great tutorial on chmod and permissions in general.

Upvotes: 1

Related Questions