jlegewie/zotfile — Issue #23: make renameAttachment function less destructive 
Author: jlegewie
Created: 2012-02-08 08:51:29+00:00
State: open
Labels: enhancement

Currently, renameAttachment often deletes an attachment item and creates a new one. Only do that when necessary (change from stored to linked attachment)

item.renameAttachmentFile(filename);
item.setField('title', filename);
item.save();

item.relinkAttachmentFile(file);