omeka-s-modules / FileSideload

GNU General Public License v3.0
2 stars 3 forks source link

Sideload removes files even when CSV error means no item is created #27

Closed mebrett closed 1 year ago

mebrett commented 2 years ago

We are doing a number of bulk uploads using CSV Import with File Sideload. For Sideload, the option "Delete sideloaded file" is turned on.

If there is an error in the CSV Import, the item for that row is not created. However, all of the media for that row is removed from the Sideload folder (we have 2-3 media per item). We luckily have backups of our files, but fixing the gaps takes extra time for us. It would be worse if we didn't have the backup.

Obviously we can turn off the auto-delete, but I wanted to note the instance of deleting the file when the item isn't completely created.

zerocrates commented 2 years ago

What kind of errors are these, things like mime types/extensions not being allowed, something like that?

The "delete" for a sideloaded file happens once it's been successfully ingested, so yes, in a more complex setup the item could be not created even though earlier sideloads have happened and "succeeded" and therefore been deleted. That's what you're describing here, right?

mebrett commented 2 years ago

Yes, it's generally either a disallowed extension or a validation error. (recent isntances include a file which somehow was .jpf instead of .jpg, and a fair number of "File does not exist or does not have sufficient permissions")

What you describe about being ingested with a semi-success sounds about right. As I said, there are 2-3 media per item, and usually only one bad media file. The other files get ingested, there's an error with the file and the item isn't created, and the good files are still removed.

jimsafley commented 1 year ago

I think the most feasible solution here is to recommend that users turn off automatic deletion when performing batch operations.