FYI PUT is misused here. From RFC 7231 [1]:<p><pre><code> The PUT method requests that the state of the target resource be
created or replaced with the state defined by the representation
enclosed in the request message payload. A successful PUT of a given
representation would suggest that a subsequent GET on that same
target resource will result in an equivalent representation being
sent in a 200 (OK) response.
</code></pre>
Placing the PUT body at a different location and returning a pointer to it is not supported by this definition. Furthermore:<p><pre><code> Proper interpretation of a PUT request presumes that the user agent
knows which target resource is desired. A service that selects a
proper URI on behalf of the client, after receiving a state-changing
request, SHOULD be implemented using the POST method rather than PUT.
If the origin server will not make the requested PUT state change to
the target resource and instead wishes to have it applied to a
different resource, such as when the resource has been moved to a
different URI, then the origin server MUST send an appropriate 3xx
(Redirection) response; the user agent MAY then make its own decision
regarding whether or not to redirect the request.
</code></pre>
That is, to get the effect you intend, you should either (a) use POST (from which you should return a 201 with the final destination, <i>not</i> 200 like you currently do), or (b) issue a 307 redirect to the final destination of the PUT before accepting any content (and subsequently replying with a 201).<p>[1] <a href="http://tools.ietf.org/html/rfc7231#section-4.3.4" rel="nofollow">http://tools.ietf.org/html/rfc7231#section-4.3.4</a>
Why give that elaborate command line call instead of the clearer, simpler one in the example?<p><pre><code> curl --upload-file ./hello.txt https://transfer.sh/hello.txt
</code></pre>
In any case - cool! Good domain name too.
FYI The "-X PUT" argument is not doing what you think it is[1], and is superfluous since you're using "--upload-file".<p>You almost never really want "-X".<p>[1]: <a href="https://curl.haxx.se/docs/manpage.html#-X" rel="nofollow">https://curl.haxx.se/docs/manpage.html#-X</a>
Haw. I made quite the same service, curl compliant and stuff except it encrypts the file on disk upon reception (creating an AES cipher, piping the file through it while receiving it) and sending back the id of the file and the key that allows decryption of said file. If anyone is interested there's plenty of documentation, even a client that allows to take screenshots and upload them on the fly.<p><a href="https://up.depado.eu" rel="nofollow">https://up.depado.eu</a><p>So yeah it's limited to 30MB for now because I don't have a lot of storage but hey I use that daily hehe
It'd be cool to have the ability to pipe stuff over the Internet from shell in real time like you would with SSH for instance. So I could do:<p>A$ curl --upload-file - <a href="http://blah" rel="nofollow">http://blah</a> < /proc/kmsg<p>B$ curl <a href="http://blah/uYsfVX" rel="nofollow">http://blah/uYsfVX</a><p>and see live stream of data on B.
Regarding their tagline: “<i>Easy file sharing from the command line</i>”, this is also possible with Yandex Disk¹ (specifically, the Linux version here²). It also has less limitations than transfer.sh, specifically:<p>• 10 GB of space for free (with a 10 GB filesize limitation³) over transfer.sh’s 5 GB<p>• no file expiration date, unlike transfer.sh’s 14-day expiration<p>――――――<p>¹ — <a href="https://disk.yandex.com/" rel="nofollow">https://disk.yandex.com/</a><p>² — <a href="https://repo.yandex.ru/yandex-disk/" rel="nofollow">https://repo.yandex.ru/yandex-disk/</a><p>³ — <a href="https://en.wikipedia.org/wiki/Comparison_of_file_hosting_services#cite_ref-94" rel="nofollow">https://en.wikipedia.org/wiki/Comparison_of_file_hosting_ser...</a>
I always wonder how sites like these deal with stuff like potentially hosting child porn/other content that is illegal to possess. Does DCMA safe harbor stuff cover it? (don't see a DCMA notice on the site)
This reminds me of a node.js-based utility I wrote awhile back called filebounce[1], except filebounce <i>streams</i> a file over HTTP/HTTPS and does not store the file on an intermediary server. It also supports tailored curl and GUI browser-based interfaces. I use it as a simple way of copying a file without needing ssh, ftp, samba, etc.<p>[1] <a href="https://github.com/mscdex/filebounce" rel="nofollow">https://github.com/mscdex/filebounce</a>
Love the idea. But the link always leads to a page with the file on it, not the file itself. Specially for picture sharing that's not really acceptable for me.
I use sprunge [<a href="http://sprunge.us/" rel="nofollow">http://sprunge.us/</a>] for the exact same purpose.<p>Normal usage:
$ more c14.py | sprunge<p>And it outputs:
<a href="http://sprunge.us/eCeM" rel="nofollow">http://sprunge.us/eCeM</a><p>The nice thing about sprunge is that you also have syntax highlighting: <a href="http://sprunge.us/eCeM?py" rel="nofollow">http://sprunge.us/eCeM?py</a><p>Appending a ?<lang> will syntax highlight the text according to the lang.<p>P.S.<p>To use a pipe with sprunge, put an alias in your .zshrc / .bashrc:<p>alias sprunge="curl -F 'sprunge=<-' <a href="http://sprunge.us"" rel="nofollow">http://sprunge.us"</a><p>and then use source ./zshrc ( or .bashrc ).
I might be unusual here, but I typically get stuck when trying to copy files off a remote Windows machine. Most recently was an aged Windows server with a version of internet explorer so old that all the modern file upload sites (e.g. <a href="https://file.io/" rel="nofollow">https://file.io/</a>) seemed to have JavaScript issues. Windows built in WebDAV support didn't work, because it's not installed on Windows server I think.<p>Can anyone come up with a way to use a service like this from an old version of Windows that lacks modern web browser, powershell and so on?
Why depend on a centralized service when there are easy-to-use decentralized alternatives?<p><pre><code> $ ipfs add myfile.txt
added QmeeLUVdiSTTKQqhWqsffYDtNvvvcTfJdotkNyi1KDEJtQ myfile.txt
# Access via a public gateway
$ curl https://ipfs.io/ipfs/QmeeLUVdiSTTKQqhWqsffYDtNvvvcTfJdotkNyi1KDEJtQ
# or via a local node
$ curl http://127.0.0.1:8080/ipfs/QmeeLUVdiSTTKQqhWqsffYDtNvvvcTfJdotkNyi1KDEJtQ</code></pre>
This requires the service to be available at all times.<p>A much more ingenious approach is ipfs: [1]<p>[1] <a href="https://ipfs.io/" rel="nofollow">https://ipfs.io/</a>
This is very cool. I build a similar tool for entire web projects called surge.sh<p><pre><code> surge path/to/project example.com</code></pre>
I built a similar service but for email:<p>Send files to i@nfil.es<p>Then you'll get something like this <a href="https://nfil.es/EOir5z/" rel="nofollow">https://nfil.es/EOir5z/</a>
Using lisp with drakma, the following function save under name some content.<p>* (defun save(name content)
(multiple-value-bind (a b c)
(http-request (format nil "<a href="https://transfer.sh/~a"" rel="nofollow">https://transfer.sh/~a"</a> name) :method :put :content (write-to-string content))
(list a b c)))
Very similar to a project of mine from 5 years ago: <a href="http://sbit3.me" rel="nofollow">http://sbit3.me</a><p>I even had a YN post: <a href="https://news.ycombinator.com/item?id=2598682" rel="nofollow">https://news.ycombinator.com/item?id=2598682</a> :)
I have been using paste.click [0] for a while, it is similar to this. I use to share snippets of code, or screenshots<p>[0] <a href="http://paste.click/" rel="nofollow">http://paste.click/</a>
You made my day;<p>I've been using <a href="http://mktorrent.sourceforge.net/" rel="nofollow">http://mktorrent.sourceforge.net/</a> for quite sometime now
Reminds me an other project: <a href="https://github.com/guits/pastefile" rel="nofollow">https://github.com/guits/pastefile</a>
I like these simple web services.<p>One I use all the time is sprunge.us -<p><pre><code> $ echo "hello world" | curl -F sprunge="<-" sprunge.us
http://sprunge.us/MEPN</code></pre>
Idea where can such service be used for nefarious purposes:<p><pre><code> while true
do
dt=$(date '+%d%m%Y%H:%M:%S');
screencapture -x file$dt.png
curl --upload-file ./file$dt.png https://transfer.sh/66nb8/capture$dt.png
rm file$dt.png
sleep 1
done</code></pre>
Unfortunately, it is not practical to run this at home, because of asymmetric up/download speeds of my internet provider (upload is 20x slower than download).<p>Sigh!
There are a lot of sites like this. The only thing that's sorta neat about this file is that the filesize limit is so high. Getting around the size limit is fairly easy by using split or something similar so that's not too big of a deal.<p>Others that come to mind are pomf.se clones like 1339.cf or comfy.moe and nekuneku's current site, uguu.se. Many paste services could also be used to achieve the same result, ix.io and sprunge.us come to mind.