Business File Management - one file, many associations?

I’m currently scoping out a file-management solution with a few unique requirements:

  • User login w/ Authorization to view files
  • (besides user login) 1 view template with 2 components: file-list/table, and a Gallery or Carousel
  • Client-side file uploads
  • Routing: https://{domain}/files/{id/tag}
  • De-coupled Salesforce integration

Basically I need to associate files to a Record ID of our CRM (Salesforce). There are Salesforce libraries that let you use S3/Drive/etc., few support actual viewing of photos due to restrictions on Salesforce’s end. Even fewer are compatible with their new Lightning UI. I don’t like the pricing of the apps that do, and in general our systems would benefit from not being coupled to Salesforce and all its many lock-in mechanisms. Instead I figured I would just make a button that opens this file manager app in a separate tab with the added benefit of allowing partner businesses access to files by way of an easy link.

Context out of the way… how would you recommend dealing with files that need to be associated to multiple records?

There are many scenarios where a file uploaded to one record needs to be accessible as a line item in another record (typically a parent). I don’t want to re-upload a file to a different bucket/folder structure in S3, that would be inefficient!. If instead I could simply create a one-to-many association for every other record that needs direct access to the file. Going the association route, how would I manage deletions without an internal representation of the data relationships?

I know there are developers out there who have much more experience with file-management problems, am I going to run into some dead-ends with this approach? Would using something like React be overkill for an app this simple? What’s the simplest, secure user authentication implementation I could use for this use case?

It sounds… it depends.

  • If you optimize the storage use, then you should upload file with own identifier, and associate them into Salesforce Records. Then you need to clean up dangling files (e.g. not associated with any records).

  • If you need to leverage S3 auth, then maybe it’s better to duplicate them.

  • If you need to synchronize a file across associated records then it’s better to keep one copy and associate it with records

1 Like