This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doUploadFile : Maybe AuthToken -> String -> File -> (Result Http.Error UploadedFile -> msg) -> Cmd msg | |
doUploadFile mbToken name file msg = | |
Http.request | |
{ method = "PUT" | |
, headers = [Http.header "Authorization" <| "Bearer " ++ (tokenToString mbToken)] | |
, url = "api/upload" | |
, body = | |
Http.multipartBody | |
[ Http.stringPart "name" name | |
, Http.filePart "file" file |
OlderNewer