开发者

i can use this 'zipme' to download source code from gae , but can not i download another file around me

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜