cvkmohan

cvkmohan

File Handling in Phoenix

Anyone felt the need for shrinerb/shrine: File Attachment toolkit for Ruby applications (github.com) sort of a library in Phoenix?
There is elixir-waffle/waffle: Flexible file upload and attachment library for Elixir (github.com) - but - not actively maintained - and - not LiveView compatible.
Phoenix LiveView does support File Uploads in a very beautiful way - it supports drag and drop, upload progress and cancel partial uploads etc. - but - boilerplate code is necessary to process the uploaded file into even local system.
Rails has two main solutions to the same problem. Rails framework itself supports ActiveStorage and then we have Shrine. Adding a file to a model is as simple as declaring any other attribute. Image Processing, Cloud Storage, Updating the Model with processed file string are all supported - and - via plugins.
Do you think such a library will help in Phoenix as well? Or there any limitations due to immutability etc.? Shrine supports ROM also which is similar to Ecto. So, in my view there should not be any issues.
But, I would want to hear your thoughts.
What problems do you perceive, if we mimic and translate Shrine into elixir?

Most Liked

karlosmid

karlosmid

Hi, maybe arc-ecto could help you:
https://github.com/stavro/arc_ecto

kokolegorille

kokolegorille

I am using live file upload with waffle and waffle-ecto.

Rails use polymorphic links (type + id)

I think arc is even less maintained than waffle :slight_smile:

cvkmohan

cvkmohan

@karlosmid - waffle is a clone of arc - because arc was not being maintained.
@kokolegorille -

  1. any github/gist links for the setup with LiveView and Waffle?
  2. I agree - polymorphic links can be a bottleneck.
    Personally, I feel waffle itself needs an upgrade - It should include akash-akya/vix: Elixir extension for libvips (github.com) or kipcole9/image: Image processing for Elixir (github.com) and delegate image processing to such libraries. A few more requirements as well. Let me see if I can get inspired from all these resources and produce something useful.

Where Next?

Popular in Discussions Top

scouten
I’m looking for a host for the server part of a small (personal) side project that I’m working on. It’s currently written in Node.js and ...
New
Qqwy
I would like to spark a discussion about the static access operator: .. For whom does not know: it is used in Elixir to access fields of...
New
andre1sk
A big advantage to Elixir is all the distributed goodness but for many applications running on multiple nodes having integrated Etcd, Zoo...
New
pillaiindu
In django there is a cache framework backed by memcached. Rails also puts a lot of emphasis on caching, and even the idea of russian-doll...
New
pdgonzalez872
If this has been asked here before, please point me to where it was asked as I didn’t find it when I searched the forum. Maybe a mailing ...
New
nburkley
AWS re:Invent is on at the moment with some interesting announcements. One new feature in particular is the Lambda Runtime API for AWS La...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39297 209
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
marciol
Please, let me know if this kind of discussion already took place in another topic . Hi all, how do you consider if is better to build ...
New
matthias_toepp
I’d love to hear what people think about Wisp, the new Gleam web framework started by Gleam’s primary creator Louis Pilfold. Gleam, alon...
New

Other popular topics Top

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
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New

We're in Beta

About us Mission Statement