I have 4.5+ years of experience in web development and debugging with php. This script cannot be written to work with php shell as the upload window will not be provided by ftp. This is http side scripting and it will require you to do it with cURL and keep active session with server, then you can upload your files as binary by fetching the upload page form with cURL and post the form with the binary file data. But this way you won't receive any confirmation if the file was uploaded or not, you will need to check for the files in your dashboard later and get their download links.