Copy folder contents to a created .zip file: 'file not found or no read permissions'

前端 未结 2 1316
清酒与你
清酒与你 2020-12-10 21:18

I\'m trying to create a .zip file from an existing folder using JScript and it seems that my copyHere function is not copying to the .zip folder. Instead I get a popup box t

相关标签:
2条回答
  • 2020-12-10 21:22

    I encountered the same problem (file not found or no read permissions' even though I have read/write privileges on the file according to the value of my file.attributes property). The problem disapeared as soon as I found and suppress a 0 length file somewhere in the directory to be copied with the copyhere method.

    0 讨论(0)
  • 2020-12-10 21:30

    As Raymond said, the problem was that I had an open reference to the .zip folder in the file variable that I created (which had a lock on the folder so I could not copy any contents to it). The solution is to call

    file.Close();

    after writing to the file, that way we can access the file to copy contents to it :)

    0 讨论(0)
提交回复
热议问题