Middleware for VMX to replace upload.php