Hey, I'm working on a script to allow users on my website to submit self-written content too my website. I have written a small code that will alow me to do this, but I have a few questions on how to customize it a little bit.
I want to be able to specify the folder that I can upload the files into so that I know when something is submitted. Also, I want to be able to limit them to just uploading .TXT files, that way no one can try to upload a virus or video file or something like that.
Here's the Upload.html page:
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Title here!</title>
</head>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
Select a file to upload! <input type="file" name="userfile"><br>
<input type="submit" value="Upload!">
</form>
</body>
</html>
Here's the Upload.php page:
<?php
if(!(copy($FILES['userfile']['tmp_name'], "Upload/" . $FILES['userfile']['name']))) die("Cannot upload files.");
echo "Upload Complete! Thank you for submitting content to The Dragonball Network.";
?>
Please let me know if you can help me. Thanks.