folgend meine Datei upload.php
<!DOCTYPE html>
<html lang="en">
<body>
<!--
Gute beschreibung was es alles für mögliche fehlerquellen gibt
https://stackoverflow.com/ques…en-uploading-files-to-php
-->
<form method="post" enctype="multipart/form-data">
<label>Upload a file:</label>
<!-- <input name="product" type="text" placeholder="Artikel-Bezeichnung" value="HUHU"> -->
<input type="file" name="dirksfile">
<button type="submit">Analyze</button>
</form>
<?php if($_SERVER['REQUEST_METHOD'] == "POST"):
print_r($_FILES); // debugging
//print_r($_SERVER);
print_r($_POST);
if ($_FILES["dirksfile"]["size"] < 20000)
{
if ($_FILES["dirksfile"]["error"] > 0)
{
echo "<p>Error: " . $_FILES["dirksfile"]["error"] . "</p>";
}
else
{
echo "<p>Upload: " . $_FILES["dirksfile"]["name"] . "</p>";
echo "<p>Type: " . $_FILES["dirksfile"]["type"] . "</p>";
echo "<p>Size: " . ($_FILES["dirksfile"]["size"] / 1024) . " kB</p>";
echo "<p>Stored in: " . $_FILES["dirksfile"]["tmp_name"] . "</p>";
}
}
else
{
echo "Invalid file. Please make sure your file is a plain text file and is small enough for this program to analyze.";
}
endif; ?>
</body>
</html>