Sorry, only JPG, JPEG, PNG, PDF & PPTX files are allowed."; $uploadOk = 0; } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { echo "

Your file was not uploaded.

"; // if everything is ok, try to upload file } else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { echo "

The file ". htmlspecialchars(basename($_FILES["fileToUpload"]["name"])) ." has been uploaded.

"; echo "

We are now processing your file. You will be redirected shortly.

"; // In a real app, you would redirect to the material preview page, e.g.: // header("Location: material_preview.php?file=" . urlencode(basename( $_FILES["fileToUpload"]["name"])))); } else { echo "

Sorry, there was an error uploading your file.

"; } } ?> Back to Home