I have a basic PHP script that I use to upload files. I can hard code the destination in the PHP script, but I want to set it dynamically via a variable I issue via curl.
Here's the script I am working on:
<?php
$target_path = "$destination";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
?>
Here is the curl command:
curl -F "destination=/tmp" -F "uploadedfile=@file.txt"
Any assistance would be greatly appreciated!
Thanks,
John
Here's the script I am working on:
<?php
$target_path = "$destination";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
?>
Here is the curl command:
curl -F "destination=/tmp" -F "uploadedfile=@file.txt"
Any assistance would be greatly appreciated!
Thanks,
John