In uploadify, once you have the filename of the uploaded file, you can call your old code using:
file_get_contents("http://yoursite.com/legacy.php?filename=" . urlencode($filename));
And then in legacy.php:
if($_FILES['picture1']['name']){
$filename = $_FILES['picture1']['name'];
}else if(isset($_GET['filename'])){
$filename = $_GET['filename'];
}
It would be a good idea to do a sanity check and make sure that $_GET['filename']
is located in a directory where you're expecting uploaded files, and isn't something like "/etc/shadow"
, since legacy.php is likely accessible to the outside web.
This isn't the best or most secure way to accomplish what you want, but it's probably the quickest and simplest.