Something like this may help:
<?php
$imageUpFile = $FILES['photo_file']['tmp_name'];
$imageType = $FILES['photo_file']['type'];
$imageName = $_FILES['photo_file']['name'];
if ($imageName != "") {
if ($thePic = fopen ($imageUpFile, "rb"))
{
//read temp file into var
$savePic = fread($thePic, filesize($imageUpFile));
$file_name = $imageName;
if ($fileHandle =
//replace username, password, url, and dir with what's relevant to you
fopen("ftp://username:password@url/dir/$file_name", "w")) {
if (fwrite ($fileHandle, $savePic))
{
echo("<p>$file_name has been uploaded!</p>");
} else {
echo("<font color=\"red\"> There's been a problem with $file_name</font>. please try again.");
}
}
fclose ($fileHandle);
fclose ($thePic);
}
}
?>
<html>
<head>
<title>file uploader</title>
</head>
<body>
<form name="upload" action="<?php echo $PHP_SELF;?>" method="post" enctype="multipart/form-data">
file to upload: <input type="file" name="photo_file">
<input type="submit" name="action" value=" upload ">
</form>
</body>
</html>