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.

Popular in Libraries
Been making an MLElixir thing (not released yet…) for fun in spare time in the past day. I’m just trying to see how much I can get an ML...
New
Could not wait for the missing Elixir ML libraries to appear, so, I wrote one myself, taking https://github.com/sdwolfz/exlearn as a foun...
New
parameterized pipe in elixir: |n>
edit: negative index in |n> and mixed usage with |> are supported
example:
use ParamP...
New
TypeCheck: Fast and flexible runtime type-checking for your Elixir projects.
Core ideas
Type- and function specifications are const...
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...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
Yes, yet another parser combinator library!
Most of the parser combinators in the ecosystem are either compile-time, often using AST tra...
New
Hi, I just published version 0.23.0 of Elixirscript.
Most of the changes are around JavaScript interop now that Elixirscript uses the ...
New
Bandit is an HTTP server for Plug and WebSock apps.
Bandit is written entirely in Elixir and is built atop Thousand Island. It can serve...
New
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application.
This library uses Erlang esaml to provide
plug enabl...
New
Other popular topics
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
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
What is the idiomatic way of matching for not nil in Elixir?
E.g.,
First way:
defp halt_if_not_signed_in(conn, signed_in_account) when...
New
I have an umbrella app.
Some of the apps inside depend on other apps in the umbrella, unsurprisingly.
I'm writing a test for one of t...
New
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
I have a User schema with a :from_id field set to type :string:
defmodule TweetBot.Repo.Migrations.CreateUsers do
use Ecto.Migration
...
New
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
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
by Lance Halvorsen
Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
New







