File Upload Glitches
Posted: Sun May 25, 2003 3:22 pm
Heres the script:
Code: Select all
<?php
$_FILES['file']['name'];
$_FILES['file']['size'];
$_FILES['file']['type'];
$_FILES['file']['tmp_name'];
global $uploaddir;
print "<pre>";
if($_FILES['file']['name'] !="")
{
move_uploaded_file($_FILES['file']['tmp_name'], $uploaddir . $_FILES['file']['name'])
or die("Could not copy the file");
//print_r($_FILES);
}
else {die("No file specified");}
?>
<html>
<head> <title>Upload complete</title> </head>
<body>
<h3>File upload succeeded...</h3>
<ul>
<li>Sent: <?php echo $_FILES['file']['name']; ?>
<li>Size: <?php echo $_FILES['file']['size']; ?> bytes
<li>Type: <?php echo $_FILES['file']['type']; ?>
</ul>
<a href="<?php echo $_FILES['file']['name'] ?>">Click here to view file</a>
</body>
</html>Following on from this I'd like to dump images into a subdir - e.g. /images
How can I achieve this???
Hope someone can help!!!