IHP Api Reference
Copyright(c) digitally induced GmbH 2021
Safe HaskellSafe-Inferred

IHP.FileStorage.Types

Description

 
Synopsis

Documentation

data FileStorage Source #

Constructors

StaticDirStorage

Stores files publicly visible inside the project's static directory

S3Storage

Stores files inside a S3 compatible cloud storage

Fields

data StoredFile Source #

Result of a storeFile operation

Constructors

StoredFile 

Fields

data StoreFileOptions Source #

Options that can be passed to storeFileWithOptions

Constructors

StoreFileOptions 

Fields

  • directory :: Text

    Directory on S3 or inside the static where all files are placed

  • contentDisposition :: FileInfo LByteString -> IO (Maybe Text)

    The browser uses the content disposition header to detect if the file should be shown inside the browser or should be downloaded as a file attachment. You can provide a function here that returns a custom content-disposition header based on the uploaded file. This currently only works with the S3 storage. See contentDispositionAttachmentAndFileName for standard configuration.

  • preprocess :: FileInfo LByteString -> IO (FileInfo LByteString)

    Can be used to preprocess the file before storing it inside the storage. See applyImageMagick for preprocessing images.

  • fileName :: Maybe UUID

    Optional filename. We use UUID for security reasons.

Instances

Instances details
Default StoreFileOptions Source # 
Instance details

Defined in IHP.FileStorage.Types

data TemporaryDownloadUrl Source #

A signed url to a file. See createTemporaryDownloadUrl

Constructors

TemporaryDownloadUrl 

Fields