+ def store(%Plug.Upload{} = file, should_dedupe, size_limit) do
+ content_type = get_content_type(file.path)
+
+ with uuid <- get_uuid(file, should_dedupe),
+ name <- get_name(file, uuid, content_type, should_dedupe),
+ true <- check_file_size(file.path, size_limit) do
+ strip_exif_data(content_type, file.path)
+
+ {:ok, url_path} = uploader().put_file(name, uuid, file.path, content_type, should_dedupe)
+
+ %{
+ "type" => "Document",
+ "url" => [
+ %{
+ "type" => "Link",
+ "mediaType" => content_type,
+ "href" => url_path
+ }
+ ],
+ "name" => name
+ }