Add file upload

This commit is contained in:
Bruno Rybársky 2024-04-25 10:49:45 +02:00
parent 8c471ca067
commit c73d471fab

@ -133,7 +133,7 @@ function parseIncomingFiles(): array
foreach ($incomingFiles as $incomingFile) { foreach ($incomingFiles as $incomingFile) {
if ($incomingFile["error"] == 0 && is_file($incomingFile["tmp_name"])) { if ($incomingFile["error"] == 0 && is_file($incomingFile["tmp_name"])) {
$type = explode("/", $incomingFile["type"]); $type = explode("/", $incomingFile["type"]);
if (str_starts_with($type, "image")) { if ($type[0] == "image") {
echo "Adding " . $incomingFile["name"]; echo "Adding " . $incomingFile["name"];
$imgFname = pathinfo($incomingFile["name"], PATHINFO_FILENAME); $imgFname = pathinfo($incomingFile["name"], PATHINFO_FILENAME);
$uploadPath = getUploadPath("image", $imgFname); $uploadPath = getUploadPath("image", $imgFname);