Changed code to save original name of attachments in temporary database