...

View Full Version : Upload feedback



vegasbp
11-05-2006, 11:58 PM
Hello, I'm making a simple upload form and I was just wondering how to say, "The file name is _______" and then post the name of the file that was used in the form.... is that possible with my code??



<?php

if($_FILES['fild']['name']){
$file_path = $_FILES['fild']['tmp_name'];
$file_name = $_FILES['fild']['name'];
$file_size = $_FILES['fild']['size'];
$file_type = $_FILES['fild']['type'];
$file_error = $_FILES['fild']['error'];

if(is_uploaded_file($file_path)){
copy($file_path, $file_name) or die('There was an error while uploading your file. Please try again.');
echo('Your file has been uploaded.<br>Thank you!');
}
}else{
?>

<form method="post" enctype="multipart/form-data">
<input TYPE="file" name="fild">
<input name="submit" type="submit" value="Upload" />
</form>
<?php
}
?>

littlejones
11-06-2006, 12:12 AM
Try this...





echo "The file name is ".$_FILES['fild']['name'];



:thumbsup:

vegasbp
11-06-2006, 12:39 AM
Thank You, I knew it was something simple like that I just couldnt remember



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum