Add file upload support. Helped by Dario Minnucci