I want to upload a file when a user visits a page. This file will always be at the same location (on a local server) and will always be uploaded to the same location (on a remote server). I have some code to upload a file, but the only examples I've found involve the file being submitted with the POST function from a form (which I cannot due since my host disabled my ability to use the POST method and will not enable it).
This is what I have for code so far...
<?php
$uploaddir = '/var/www/uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}
echo 'More debug info:<BR>';
print_r($_FILES);
?>
How do I tell it what file I am submitting from my local server? I think it would work if I could just get that bit added in.