AnsweredAssumed Answered

Appending (.txt) file to Zip File

Question asked by jared_pilbeam on Nov 29, 2016
Latest reply on Nov 30, 2016 by dkwiens



There's a similar thread here but it's sort of left unanswered: Adding extra files to a zip? 


I have this script to append to a zip file archive:

import zipfile

print 'appending to the archive'
zf = zipfile.ZipFile('W:\Data\', mode='a')
    zf.write('Z:\Jared\Disclaimer - Final.txt')


The problem is that I included the whole file path on line 6, so the whole folder (Jared) was appended to the zip and not just the (.txt) file.


If I exclude the path and type only the file name it can't be found? 


Is there a way to just append the (.txt) file to the zip file?