Popularity
4.6
Declining
Activity
0.0
Stable
9
3
0
Monthly Downloads: 21
Programming language: Haskell
License: MIT License
yesod-transloadit alternatives and similar packages
Based on the "yesod" category.
Alternatively, view yesod-transloadit alternatives based on common mentions on social networks and blogs.
-
yesod-persistent
A RESTful Haskell web framework built on WAI. -
yesod-fay
Utilities for using the Fay Haskell-to-JS compiler with Yesod. -
yesod-dsl
A domain specific language and a code generator desined to create RESTful services for managing an RDBMS with Yesod web framework and Persistent. -
yesod-job-queue
Background job queue library for Yesod. -
yesod-crud
Generic administrative CRUD operations as a Yesod subsite -
yesod-auth-hashdb
Yesod.Auth.HashDB plugin, now moved out of main yesod-auth package -
yesod-routes-typescript
generate TypeScript routes for Yesod -
yesod-auth-fb
Authentication backend for Yesod using Facebook. -
yesod-content-pdf
Library for serving PDF content from a Yesod Application -
yesod-recaptcha
Dead simple support for reCAPTCHA on Yesod applications. -
yesod-text-markdown
Yesod support for Text.Markdown -
yesod-comments
Drop-in comments module for a Yesod application -
yesod-goodies
Small utilities useful in any yesod web app -
yesod-form-bootstrap4
yesod-form for bootstrap version 4 -
yesod-worker
Drop-in(ish) background worker system for Yesod applications -
yesod-auth-account-fork
Fork of yesod-auth-account with a few additions -
yesod-raml
Generate Yesod framework route definitions, documentaiton, mock-handler, and more from your RAML spec. -
yesod-crud-persist
Easy CRUD subsites for yesod with persistent -
yesod-auth-kerberos
Kerberos support for Yesod Auth -
yesod-auth-smbclient
Authentication plugin for Yesod using smbclient -
yesod-datatables
Routines for implementing server-side processing for DataTables (jQuery grid) in Haskell -
yesod-fb
Useful glue functions between the fb library and Yesod. -
yesod-auth-zendesk
Zendesk remote authentication support for Yesod apps. -
yesod-auth-hmac-keccak
An account authentication plugin for yesod with encrypted token transfer. -
yesod-auth-bcrypt
BCrypt salted and hashed passwords in a database as auth for yesod -
yesod-auth-deskcom
Desk.com Multipass support for Yesod apps. -
yesod-pnotify
yet another getMessage/setMessage using pnotify jquery plugins -
yesod-test-json
Utility functions for testing JSON web services written in Yesod -
yesod-auth-ldap-native
Yesod LDAP authentication plugin using native Haskell Ldap.Client -
yesod-paypal-rest
Yesod plugin to use PayPal with the paypal-rest-client library. -
yesod-articles
Automatically generate article previews for a yesod site -
yesod-s3
Simple Helper Library for using Amazon's Simple Storage Service (S3) with Yesod
Access the most powerful time series database as a service
Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
Promo
www.influxdata.com
Do you think we are missing an alternative of yesod-transloadit or a related project?
README
yesod-transloadit
This is a reusable Yesod widget for the Transloadit web service. This widget:
- Injects Javascript dependencies into your frontend
- Computes & injects the Transloadit snippet
- Computes a server side signature for Transloadit's signature authentication
- Parses responses from Transloadit
Here's an example, using Transloadit to crop an uploaded image:
-- Make a Yesod app
data Test = Test
mkYesod "Test" [parseRoutes| / HomeR GET POST |]
instance Yesod Test
instance YesodJquery Test
instance YesodTransloadit Test
instance RenderMessage Test FormMessage where
renderMessage _ _ = defaultFormMessage
We use an Input form for flexibility. This means we need to look after CSRF ourselves.
getHomeR :: Handler Html
getHomeR = defaultLayout $ do
now <- liftIO getCurrentTime
-- Create an id for your form
ident <- newIdent
-- Create some Transloadit params, you need: Expiry time; Api key; Template Id; Form id
let expiry = addUTCTime 3600 now
key = Key "my_key"
template = Template "my_template"
secret = Secret "my_secret"
params = mkParams expiry key template ident secret
-- Load the widget, and retrieve the given signature
sig <- either (const $ error "nooo") transloadIt params
-- CSRF considerations, tokenText is a helper that tries to extract the current CSRF token
t <- tokenText
-- Create a form
[whamlet|
<form id="#{ident}" [email protected]{HomeR} method="POST">
<input type="hidden" name="_token" value="#{t}">
<input type="hidden" name="signature" value="#{sig}">
<input type="file" name="my_file">
<input type="submit" value="Upload">
|]
return ()
The handler for our form is quite simple, we try to parse the results (using the nthStepResult
helper) and present an image:
postHomeR :: Handler Html
postHomeR = defaultLayout $ do
results <- handleTransloadit
-- my_template contains a step called "cropped_thumb"
case nthStepResult results "cropped_thumb" 0 of
Just s -> let imageSrc = s ^. sslUrl in
[whamlet|
$case imageSrc
$of Just url
<img src="#{show url}"/>
$of _
<p>invalid URL after upload
|]
_ -> [whamlet| No results :( |]
return ()
Run it!
exampleServer = warp 4567 Test