I have this code in the php file
<?php
$file_size = $_FILES['file']['size'];
if($file_size > 1048576){
print"Your File Size Exceeded the Limit of 1 Megabyte.";
}else{
$oldfile = basename($_FILES['file']['name']);
// getting the extention
$pos = strpos($oldfile,".",0);
$ext = trim(substr($oldfile,$pos+1,strlen($oldfile))," ");
if($ext == swf || jpeg || jpg || gif || png || tiff || rif || bmp){
$target_path = "/";
$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['file']['name']);
$_FILES['uploadedfile']['tmp_name'];
if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['file']['name']). " has been uploaded<br \>";
} else{
echo "There was an error uploading the file, please try again!";
}
}else{
print'Not a current file type that can be uploaded';
}
}
?>
That works perfectly fine and just to say this is my html code.
<html>
<head>
<title>Upload Your File</title>
</head>
<body>
<form action="manage.php" method="post" enctype="multipart/form-data">
<input type=file name=file> <BR>
<input type="submit" value="Upload">
</form>
</body>
</html>
I want it so when it uploads, on the same page as the upload page(html page) there is a box that says where the file is. Also i want it so when it uploads the file it changes the name to random letters so people don’t upload the same file twice and it overwrites each other. I hope this isn’t too much to ask.