import os
import zipfile

def zip():

    form = FORM(TABLE("", INPUT(_type="submit",_value="SUBMIT")))

    if form.accepts(request.vars):

        uploaded_files = os.listdir([os.getcwd
(),'applications',request.application, 'uploads'])
        zipf = zipfile.Zipfile(os.getcwd(),
'applications',request.application,
'uploads','uploads_backup.zip','w')
        for f in uploaded_files:
                try: zipf.write(f)
                except: pass
        #return encode('rot13')

        f.close()


    return dict(form=form)
    return unicode


On Feb 10, 1:59 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> please post code and traceback else it is hard to figure out what the
> issue is.
>
> Massimo
>
> On Feb 9, 11:52 pm, INeedHelp <zhang.kil...@gmail.com> wrote:
>
>
>
> > I want to zip a file in a folder.
> > but with this error
>
> > TypeError: coercing to Unicode: need string or buffer, list found- Hide 
> > quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to