Re-upload a file on an Entity - Does it overwrite the File Attachment?


On every Project we are uploading a ZIP file on a Published File. If this ZIP file is modified then we simply re-upload it on the same Entity. We do this to avoid versioning this ZIP file in ShotGrid since we don’t want to full our ShotGrid Storage with that.

But today I noticed that when I re-upload the ZIP file on the same Published File, it’s not replacing the File Attachment, it’s creating a new one instead. (Discovered that by looking at the File Attachment Page).

So my question is: If I re-upload a file on an existing Published File, does it overwrite the previous File Attachment or is it creating a new File Attachment and it fills up ShotGrid’s storage?

I think attachments are immutable, and cannot be overwritten. That said, maybe ShotGrid has reference counting and deletes attachments that are not referenced after some time? I don’t know. Or the storage just fills up and it’s slow enough not to matter too much.

I really hope the same thing or else I’ll need to delete the attachments that are not referenced on my Published Files that we update frequently.

Any answer from Support team?

AFAIK attachment fields act as pointers to SG file entities. Every attachment upload should create a new file entity and update the attachment to point to the new entry. I’m not aware of any process to reap historical file entities that are no longer actively referenced and I doubt there is one. All this data generally lives on an S3 bucket which means it shouldn’t encroach on any of the SG server’s storage. Plus, the pricing model for S3 is generally based on file access/download patterns, which means there’s likely no cost incentive for purging data from the bucket that’s not actively accessed.

1 Like

just before your answer I just added something that deletes older/deprecated Attachments on my specific entities.

So from your answer, this wont be necessary? :point_up_2:

I imagine not @sbissonnette. If you’re deleting an attachment field you’re likely just clearing a pointer. You might want to confirm by checking the entries in the file entity list before and after your delete operation. Odds are good they’ll be unaffected.

Thanks for your answer @nico.vandenbosch !

Hope support Team will give their answer as well