actually just delete it .. since the error occurred before it was inserted into the files database table.
BTW, this is the same mechanism that can cause corruption in a running database server. If someone uses "copy" on a running database, it places a file lock on the database, and it can corrupt it. That is why Windows 2003 has a thing called shadow copy, and why one should use database specific backup tools.
I will take a look into shadow copy. I thought cache-listener files are not part of the database and can be safely copied. There is no tools to backup cache-listener folder when the database is runninglike FIBS with the database file. Other than trying shadow copy, what if you place the tempory file in a separate folder (windows default temp folder, for example, or Synapse's own temp folder) and MOVE instead of RENAME the file after the upload is completed?