tags:

views:

219

answers:

2

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')
+1  A: 

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.

Bartek
i have tried changing permissions, but the zip files are getting uploaded to the same folder, it doesn't extract
bocca
A: 

it works with ZipFile.extractall

bocca