MrDoops

MrDoops

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?

Most Liked

chulkilee

chulkilee

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

Where Next?

Popular in Questions Top

vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
Kagamiiiii
Student & New to elixir. Nice language. I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
kostonstyle
Hi all I want to have a unix time, from the current time plus 1 hour. DateTime.now + 1 hour How to get it in elixir? Thanks
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New

We're in Beta

About us Mission Statement