Git Product home page Git Product logo

pastebin-yesod's Introduction

Paste

Usage:

<command> | curl -F 'file=@-' -H 'Expect:' http://localhost:3000

Features:

  • Very easy to use
  • Supports binary files
  • Keeps the Content-Type
  • Preserves filenames, sent as Content-Disposition
  • Optional expiration (self-destruct)

Details

File: Send a POST request to this page with your data in the "file" field name, the entire url uploaded is sent back or a HTTP 302 is replied.

Expiration: One can specify the number of minutes after which the file should be deleted. Specified by the "expire" field. Alternatively you can specify the time unit: s(econds), h(ours), d(ays), w(eeks), m(onths). Example: 120 (2 minutes), 2m (2 months).

Content-Type: It allows the browser or client to infer types of files to correctly display them. cURL cannot infer the type of piped input so you could explicitly give the content type (1st below) or pass it the file directly (2nd below) so it can find the type itself (look at man curl).

Content-Disposition: It allows to suggest a filename to the browser. That means we can store filenames we received and provide them afterward. cURL takes the filename of the path or you can provide it separately (see below).

Examples

curl -F 'file=@/path/to/file' -H 'Expect:' http://localhost:3000
<command> | curl -F 'file=@-;type=image/jpeg;filename=myphoto.jpg' -H 'Expect:' http://localhost:3000
<command> | curl -F 'file=@-' -F 'expire=1d' -H 'Expect:' http://localhost:3000

Expect: If you are wondering about this Expect, this is a HTTP header that our server does not support, so we say cURL not to send it and it just works as expected :)

There is no guarantee of services of any kind. Note your IP address is stored for security reasons.

Coded with Yesod in Haskell by Axel Angel for GNU Generation, 2014.

pastebin-yesod's People

Contributors

axel-angel avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.