mathieuprog
Uploader - file upload with fine control over how a Plug.Upload is casted and stored
Hello ![]()
This is my second published Elixir library ![]()
There are already many file upload libraries, but this one was created to allow the user to personalize:
- how a
Plug.Uploadstruct is casted into the value that must be stored in db; - the filename(s) that must be generated based on a given schema struct;
- the strategy to apply when a file path already exists;
- etc.
This allows to address some more specific use cases.
Example: imagine a CMS allowing to upload the cover image of a blog post. The blog post is written into multiple languages. For SEO purposes, we want the filename of the cover image also to be translated into these languages (this is particularly important for an online business which relies heavily on SEO techniques to obtain incoming web traffic). For this case, the library will allow to:
- cast the
Plug.Uploadstruct into a map of filenames per language; - return multiple filenames for a single upload (multiple files will be stored);
- print the file URL based on the reader’s language.
That use case is really very specific, but it was the motivation behind the writing of that library.
https://github.com/mathieuprog/uploader
![]()
Popular in Announcing
I created a new library (rather I pulled out a couple files from my big project), it manages an operating system PID file for the BEAM.
...
New
Just looking for a little feedback on a tiny helper library I built -
Sometimes I find the need to convert maps with atom keys to maps w...
New
Hi, I wanted share a small library we at Revelry Labs made for rendering react components from the server side. There are instructions fo...
New
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch.
This project took far...
New
I’ve been working on two packages (not on hex.pm yet) to build admin interfaces for phoenix apps:
bureaucrat - which contains a bunch ...
New
Hey all,
We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3!
We have successfully on-boarded the full suite of integration tests (...
New
Lexical
Lexical is a next-generation language server for the Elixir programming language.
Features
Context aware code completion
As-you...
New
Other popular topics
Hi guys, i’m new in the Elixir world, and i have to say, that i love it!
i’m having some problem to understand anonymous functions with ...
New
Lets say I have map like this fetching from my database
%{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
Hi All,
I set a environment variables in dev.exs , like below code.
when i start server, how can i set the ${enable} value?
thanks.
d...
New
Credo is smart enough to check for (something like) this:
assert length(the_list) == 0
with this response:
Checking if an enum is empt...
New
What learn first? Rust or Elixir
Hi Elixir community!
I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









