Hoogle Search
Within LTS Haskell 24.52 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
snap-core Snap.Util.FileUploads Processes form data and calls provided storage function on file parts. You can use this together with withTemporaryStore, storeAsLazyByteString or provide your own callback to store uploaded files. If you need to process uploaded file mime type or file name, do it in the store callback function. See also foldMultipart. Example using with small files which can safely be stored in memory.
import qualified Data.ByteString.Lazy as Lazy handleSmallFiles :: MonadSnap m => [(ByteString, ByteString, Lazy.ByteString)] handleSmallFiles = handleFormUploads uploadPolicy filePolicy store where uploadPolicy = defaultUploadPolicy filePolicy = setMaximumFileSize (64*1024) $ setMaximumNumberOfFiles 5 defaultUploadPolicy store partInfo stream = do content <- storeAsLazyByteString partInfo stream let fileName = partFileName partInfo fileMime = partContentType partInfo in (fileName, fileMime, content)
setMaximumFormInputSize :: Int64 -> UploadPolicy -> UploadPolicysnap-core Snap.Util.FileUploads Set the maximum size of a form input which will be read into our rqParams map.
setMaximumNumberOfFormInputs :: Int -> UploadPolicy -> UploadPolicysnap-core Snap.Util.FileUploads Set the maximum size of a form input which will be read into our rqParams map.
setProcessFormInputs :: Bool -> UploadPolicy -> UploadPolicysnap-core Snap.Util.FileUploads Set the upload policy for treating parts without filenames as form input.
-
snap-core Snap.Util.Proxy Use the Forwarded-For or X-Forwarded-For header
transformBi :: Biplate from to => (to -> to) -> from -> fromuniplate Data.Generics.Biplate No documentation available.
transformBiM :: (Monad m, Biplate from to) => (to -> m to) -> from -> m fromuniplate Data.Generics.Biplate No documentation available.
transform :: Uniplate on => (on -> on) -> on -> onuniplate Data.Generics.Uniplate Transform every element in the tree, in a bottom-up manner. For example, replacing negative literals with literals:
negLits = transform f where f (Neg (Lit i)) = Lit (negate i) f x = x
transformM :: (Monad m, Uniplate on) => (on -> m on) -> on -> m onuniplate Data.Generics.Uniplate Monadic variant of transform
-
uniplate Data.Generics.Uniplate.Data No documentation available.