{"id":3451,"date":"2017-04-16T13:53:51","date_gmt":"2017-04-16T12:53:51","guid":{"rendered":"https:\/\/www.gamlor.info\/wordpress\/?p=3451"},"modified":"2021-03-11T09:42:56","modified_gmt":"2021-03-11T08:42:56","slug":"transfer-files-via-web-curl-rohrli-gamlor-info","status":"publish","type":"post","link":"https:\/\/www.gamlor.info\/wordpress\/2017\/04\/transfer-files-via-web-curl-rohrli-gamlor-info\/","title":{"rendered":"Transfer Files via Web: curl https:\/\/rohrli.gamlor.info"},"content":{"rendered":"<p>Did you ever have this situation: You&#8217;re SSH&#8217;ed into a box. Or worse, you&#8217;re on some corporate *hmmkkmm slow* VPN, over which you SSH&#8217;ed into a box. Or worse, corporate VPN, use RDP to some Windows server, on that opening some tool thing which has a console to a virtual machine? And you need to want to transfer some 10&#8217;s of megs or more debug data out?<br \/>\nIf you&#8217;re lucky, you get a slow transfer going. If you&#8217;ve bad luck, there no sane way to directly transfer the data.<br \/>\nThen you waste time trying to use a &#8216;send files via web&#8217; service&#8230;oh god. And in the end you might move data via some server you control =(.<\/p>\n<h2>Why can&#8217;t I just user CURL? <\/h2>\n<p>Yes, why can&#8217;t I just use use CURL. Like, I &#8216;upload&#8217; the data via curl, and download it at the other end. Like a simple pipe. No signing up, sending emails which links to the &#8216;large file&#8217;, no need for a browser.<\/p>\n<p>I basically just wanted something like.<\/p>\n<pre>\r\ngamlor@machine-a: cat my-data | curl\r\ngamlor@machine-b: curl &gt; my-data\r\n<\/pre>\n<p>Nothing more. It does need to store it. Just a file transfer!<br \/>\n<div id=\"attachment_3461\" style=\"width: 810px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gamlor.info\/wordpress\/wp-content\/uploads\/2017\/04\/why-rohrli.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-3461\" src=\"https:\/\/www.gamlor.info\/wordpress\/wp-content\/uploads\/2017\/04\/why-rohrli.jpg\" alt=\"File Transfer Trouble\" width=\"800\" height=\"2145\" class=\"size-full wp-image-3461\" srcset=\"https:\/\/www.gamlor.info\/wordpress\/wp-content\/uploads\/2017\/04\/why-rohrli.jpg 800w, https:\/\/www.gamlor.info\/wordpress\/wp-content\/uploads\/2017\/04\/why-rohrli-112x300.jpg 112w, https:\/\/www.gamlor.info\/wordpress\/wp-content\/uploads\/2017\/04\/why-rohrli-768x2059.jpg 768w, https:\/\/www.gamlor.info\/wordpress\/wp-content\/uploads\/2017\/04\/why-rohrli-382x1024.jpg 382w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><p id=\"caption-attachment-3461\" class=\"wp-caption-text\">File Transfer Trouble<\/p><\/div><\/p>\n<h2>curl https:\/\/rohrli.gamlor.info<\/h2>\n<p>So I built it for myself =). And here it is: R\u00f6hrli, pipe files via web: <a href=\"https:\/\/rohrli.gamlor.info\"><\/a>.<\/p>\n<p>You start by pointing CURL at it. Do not miss the S in httpS =).  It will then give you a guide. A example:<\/p>\n<pre>\r\ncurl https:\/\/rohrli.gamlor.info\r\n\r\n>    R\u00f6hrli: Pipe your files via Web.\r\n> \u207c\r\n>    cURL guide:\r\n>\r\n>    Basics:\r\n>    - Shows this help text. (or web page in a browser)\r\n>        curl https:\/\/rohrli.gamlor.info\r\n>    - Pipe a file to r\u00f6hrli. It will respond with an URL:\r\n>        cat my-file | curl -N --data-binary @- https:\/\/rohrli.gamlor.info\r\n>    - Gzip if needed:\r\n>        cat my-file | gzip | curl -N --data-binary @- https:\/\/rohrli.gamlor.info\r\n>    - The request will give you an URL. Then read from it on another place:\r\n>        curl {the-url-returned} > my-file\r\n>\r\n>    Any question? Email: roman.stoffel@gamlor.info. Twitter: @gamlerhart\r\n<\/pre>\n<p>Then you pipe your file \/ data to curl. As told by the instruction. After that, you&#8217;re receive instructions how do download the data.<br \/>\nDo not stop CURL. R\u00f6hrli does not store the file on the server. It just transfers data from the uploader to the downloader.<\/p>\n<pre>\r\necho data > test-file.txt\r\ncat test-file.txt | curl -N --data-binary @- https:\/\/rohrli.gamlor.info\r\n\r\n>    You're pipe was created at https:\/\/rohrli.gamlor.info\/vykkev-xizras-puzwyq-vauveq\r\n>\r\n>    Download it with:\r\n>    - curl https:\/\/rohrli.gamlor.info\/vykkev-xizras-puzwyq-vauveq > my-file.txt\r\n>    If you uploaded gzipped, decompress:\r\n>    - curl https:\/\/rohrli.gamlor.info\/vykkev-xizras-puzwyq-vauveq | gzip -d > my-file.txt\r\n>\r\n>    This pipe is streaming. No data is permanently stored on the server.\r\n>    Do not quit (Ctrl-C\/D) before the transfer is done.\r\n>\r\n>    Verify that the download is complete and correct with: sha1sum my-file.txt\r\n>    \r\n>    Start your download now. We're waiting for the download to start for 10 minutes\r\n>    ......\r\n<\/pre>\n<p>As you see, you get a unique link. You now can download it =). You might want to double check the download with something like sha1sum.<\/p>\n<pre>\r\ncurl https:\/\/rohrli.gamlor.info\/vykkev-xizras-puzwyq-vauveq > my-file.txt\r\n\r\n>    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\r\n>                                    Dload  Upload   Total   Spent    Left  Speed\r\n>    100     5  100     5    0     0      2      0  0:00:02  0:00:02 --:--:--     2\r\n<\/pre>\n<p>And you&#8217;re done!<br \/>\nUp and downloading of course also work with a browser =).<\/p>\n<p>That&#8217;s about it. If you find a bug or have wishes, let me know =)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Did you ever have this situation: You&#8217;re SSH&#8217;ed into a box. Or worse, you&#8217;re on some corporate *hmmkkmm slow* VPN, over which you SSH&#8217;ed into a box. Or worse, corporate&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[268,187],"tags":[308,307,309],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/posts\/3451"}],"collection":[{"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/comments?post=3451"}],"version-history":[{"count":22,"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/posts\/3451\/revisions"}],"predecessor-version":[{"id":3494,"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/posts\/3451\/revisions\/3494"}],"wp:attachment":[{"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/media?parent=3451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/categories?post=3451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gamlor.info\/wordpress\/wp-json\/wp\/v2\/tags?post=3451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}