views:

29

answers:

1

i follow this article : zipme

and i download my file successful , and i want to download another file that ex: the parent file

so i change this:

dirname=os.path.dirname
folder = dirname(__file__)

to

dirname=os.path.dirname
folder = dirname(dirname(__file__))

but the error is :

firefox can't find the file

why ?

thanks

A: 

You get the error, because something fails in the script and it won't return a valid ZIP file back in the response.

The most probable reason is because your zipme.py will be in the root of your application. So if you try to get the parent folder of your root folder (returned by dirname(__file__)) it will fail because there is no parent folder (or at least not accessible by your code).

As far as I can see there would be no reason to execute the code you want to execute, because the original dirname(__file__) should already ZIP all your application's files.

tomlog