Panel 1: Two persons stansing in front of a wall that is not completely pastered. The left person holds a bucket full of concrete and a toothbrush. Right person: "Hi. What's up?" Left person: "I plaster this wall with an electric toothbrush." -- Panel 2: Right Person: "Why would you do that?" Left Person (points to a sheet of paper he holds): "This study shows that this is 45% more effective compared to manual toothbrushes!" Left Person: "Interesting." Subtitle: "Scientific reasoning"

A person decided to make sourdough and left it for fermentation. And forgot about it. So the sourdough evolved consciousness and thought: "I want to take over the world!"

External Content not shown. Further Information.

A dirty and smelly steaming toilet is shown. A person points with his finger to this toilet: "This toilet needs to be cleaned." A plumber with a plunger in his right hand, jumping for joy: "Yippeeeeeeeeeh!" Subtitle: "In 2048, genetic engineering produced some weird results."

I am still without a fast internet connection, so please forgive me, only two links this time again:
Drawing a circle with Bézier Curves
Man kann ja über Hitler sagen was man will....

Panel 1: A transparent foil with dots showing "LED", a needle with a thread, and scissors are shown. Subtitle: "The advanced OLED research brought new highly sophisticated textiles, which made it possible to change their design on demand." -- Panel 2: A female model is shown in three different outfits. Subtitle: "Combined with wireless technology, everything required to change one's appearance is a computer." -- Panel 3: A woman with a laptop is sitting at a park bench, venmously grinning. In front of her stands a shocked man in underpants. Subtitle: "Still, whenever there are computers, there are also hackers."


Found at XKCD
The well-known problem of transferring a file is comparably hard to solve: There are plenty of possibilities for file transferring, and as long as you work with somebody who knows how to use them, you usually find a possibility to do so. The original problem arose from NATs, which do not provide you a direct port for listening.

Meanwhile, with the rise of VoIP, this problem is solved in most cases. Routers can be configured to support UPnP, for example. The main problem is that there are plenty of people not knowing how to use tools like, say, scp. And many people are not willing to use any program that is not already installed on their system. They will try to use filehosters, and if you insist on security, they will compress the whole stuff into an encrypted RAR archive - if they have RAR.

So there is a certain motivation to have at least an own upload server - at least you can (mostly) rely on the person having some sort of webbrowser. Of course, there are plenty of PHP Upload Scripts out there. However, the other person might have a slow internet connection, and the file may be several gigabytes large. Which is mostly out of the bounds of your usual Apache and PHP configuration. And changing this configuration can be a real pain, as relevant configuration options are scattered all over the system, and you are likely to miss one and make the upload fail - and you may not want to configure such an upload site just for the casual use.

So, my approach was to use Clisp with Hunchentoot. Clisp is small, and Hunchentoot is simple but powerfull and gives me full control. I installed the necessary packages with Quicklisp, and produced the following code:

(ql:quickload :cl-base64)
(ql:quickload :hunchentoot)

(hunchentoot:define-easy-handler (index :uri "/index") ()
    "<form enctype=\"multipart/form-data\" action=\"upload\" method=\"POST\">
 Please choose a file: <input name=\"uploaded\" type=\"file\" /><br />
 <input type=\"submit\" value=\"Upload\" />
 </form>")

(hunchentoot:define-easy-handler (upload :uri "/upload") (uploaded)
    (rename-file (car uploaded)
        (concatenate 'string "/tmp/"
        (cl-base64:string-to-base64-string (cadr uploaded))))
    "SUCCESS")

(hunchentoot:start (make-instance 'hunchentoot:easy-acceptor :port 8000))

The uploaded file will be moved to /tmp/, and be named as the base64-representation of the name given by the client (to prevent any exploits). As you may notice, this is a script that is not made for "production use". I can just run it when I need it, let it run until the file is uploaded, and then stop it again. This is exactly what I need.

Well, one possible extension would be to add UPnP-Support, so I do not have to manually forward my router's port to use it.
Update: Notice that you should set LANG=C or something similar, otherwise binary data might be re-encoded.



 





Panel 1: A television is shown, which shows a newscast. In the background of the newscast, a prohibition sign with a button is shown. The speaker sais: "Don't push the button!" -- Panel 2: Person driving a car. The radio sais: "Don't push the button!" -- Panel 3: Person reading newspaper. Newspaper shows prohibition sign with a button, and the title "Don't push the button!" -- Panel 4: Person in front of a machine, which looks like a cube with a button on the top. Person: "Let's see how this thing works." -- Panel 5: Person pushes button, and gets shocked, "*zzzzzzz*". -- Panel 6: Person still standing in front of the machine: "Damn. These things are dangerous. There should be laws against them." -- Subtitle: "User conduct"