In the HTML form:
<form action="upload.php" enctype="multipart/form-data" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="whateverbytesizeyoulikeasalimit">
File to Upload: <input type="file" name="fileupload"><br><br>
<input type="submit" value="upload">
</form>
In the PHP file named upload.php:
<?php
$file_dir = "/pathtowhereyouwantthefiletobesaved/";
foreach($_FILE as $file_name => $file_array) {
print "path: ".$file_array['tmp_name']. "<br>\n";
print "name: ".$file_array['name']. "<br>\n";
print "type: ".$file_array['type']. "<br>\n";
print "size: ".$file_array['size']. "<br>\n";
if (is_uploaded_file($file_array['tmp_name'])) {
move_uploaded_file($file_array['tmp_name'], "$file_dir/$file_array[name]") or die ("Couldn't copy");
print "file was moved! <br><br>";
}
}
?>
I had one other code that worked in similar ways, just more particular on what file types was accepted etc. Cant find it now though. Even though this doesnt save the file to no database or anything like that, I hope it can help you at least move the files over to the server. 🙂 good luck
🙂