Refactored
Now supports new php_upload adapter support