For upload, check the manual (there is such chapter).
For download: you can just call the image (through web browser) and use "Save as". If you want to download it right away, write a script that will prepend header "Content-type: application/octet-stream" to the image.