Here is some sample codes that you can try...
import os, zipfile
uploaded_files = os.listdir('../uploads')
zipf = zipfile.Zipfile('../uploads/uploads_backup.zip', 'w')
for f in uploaded_files:
try: zipf.write(f)
except: pass ## only put files in the zipfile, not
directories
f.close()
Cheers
Maurice
On Feb 6, 2:41 pm, INeedHelp <[email protected]> wrote:
> 1st
> I know how to zip a file but is there a way to zip a folder (with
> files contain inside).???
>
> 2nd
> Is there a way to move a file and folder after zip that folder and
> file?
>
> thanks in advance
>
> cheers
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---