Fix error when a linked file appears twice in an export (e.g., in two subcollections)

This commit is contained in:
Dan Stillman 2009-04-27 01:45:15 +00:00
parent b0e5b1763a
commit a2ce69aee1

View file

@ -2066,9 +2066,9 @@ Zotero.Translate.prototype._exportGetAttachment = function(attachment) {
createInstance(Components.interfaces.nsILocalFile);
directory.initWithFile(this._exportFileDirectory);
directory.append(attachmentArray.itemID);
directory.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0700);
// copy file
try {
directory.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0700);
file.copyTo(directory, attachmentArray.filename);
} catch(e) {
attachmentArray.path = undefined;