Skip to content

Commit

Permalink
Replace IHP.FileStorage.MimeTypes with Network.Mime
Browse files Browse the repository at this point in the history
  • Loading branch information
mpscholten committed Dec 13, 2024
1 parent 89b762d commit ed20efe
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 1,055 deletions.
4 changes: 2 additions & 2 deletions IHP/FileStorage/ControllerFunctions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import qualified System.Directory as Directory
import qualified Control.Exception as Exception
import qualified Network.Wreq as Wreq
import Control.Lens hiding ((|>), set)
import IHP.FileStorage.MimeTypes
import qualified Network.Mime as Mime

-- | Uploads a file to a directory in the storage
--
Expand Down Expand Up @@ -179,7 +179,7 @@ storeFileFromUrl url options = do
--
storeFileFromPath :: (?context :: context, ConfigProvider context) => Text -> StoreFileOptions -> IO StoredFile
storeFileFromPath path options = do
let fileContentType = path |> guessMimeType |> cs
let fileContentType = Mime.defaultMimeLookup (cs path)

fileContent <- LBS.readFile (cs path)
let file = Wai.FileInfo
Expand Down
Loading

0 comments on commit ed20efe

Please sign in to comment.