Requirements : PHP
This tutorial will cover how to make a basic PHP upload script. You can easily convert or change it.
You need a PHP enabled host, the ability to upload, and HTML or PHP knowledge to change the script around to fit your needs
This is the basic code:
<form enctype="multipart/form-data" action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="2048000">
File: <input name="userfile" type="file" /><br />
<input type="submit" value="Upload" />
</form>
<?php
if (@is_uploaded_file($_FILES["userfile"]["tmp_name"])) {
copy($_FILES["userfile"]["tmp_name"], "/images/" . $_FILES["userfile"]["name"]);
echo "<p>File uploaded successfully.</p>";
}
?>You can change the "/images/" to any directory you want.
You may also want to password protect the file. This is so only webmasters or selected people can view it.
[mod edit] Made a litttle change to the code to rid it of error. --hotsnoj






MultiQuote








|