Posted by Glenn Coyle on 09/25/06 19:46
Hi
I am having issues with trying to upload files to a directory on my
server. the first script is the form the second is the upload file, it
just doesnt identify the file path where it is being uploaded from.
Any ideas?
<form action="getFiles.php" method="get"><br>
Type (or select) Filename: <input type="file" name="uploadFile">
<input type="hidden" name="MAX_FILE_SIZE" value="25000" />
<input type="submit" value="Upload File">
</form>
getfiles.php
<?
$target_path = "../slices/";
$target_path = $target_path . basename( $_FILES['uploadFile']['name']);
echo $_FILES['uploadFile'];
if(move_uploaded_file($_FILES['uploadFile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadFile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
?>
I just cant see what is wrong. Please help.
Thanks
Glenn
Navigation:
[Reply to this message]
|