Plug.Upload
A server that manages uploaded files.
Uploaded files are stored in a temporary directory and removed from the directory after the process that requested the file dies.
During the request, those files are represented with the Plug.Upload struct that contains three fields:
:path
- the path to the uploaded file on the filesystem:content_type
- the content type of the uploaded file:filename
- the filename of the uploaded file given in the request
Summary
random_file!(prefix) | Requests a random file to be created in the upload directory with the given prefix. Raises on failure |
random_file(prefix) | Requests a random file to be created in the upload directory with the given prefix |
start_link() | Starts the upload handling server |
Functions
Specs:
- random_file(binary) :: {:ok, binary} | {:too_many_attempts, binary, pos_integer} | {:no_tmp, [binary]}
Requests a random file to be created in the upload directory with the given prefix.
Specs:
- random_file!(binary) :: binary | no_return
Requests a random file to be created in the upload directory with the given prefix. Raises on failure.