This is completely untested (other than compiling & linking).
Attach a file by drag & drop or click to upload