PHP-Upload-Formular, PDF, Doc & Docx

Ich habe Mühe, diesen Upload-Code für eine docx-Datei zu verwenden. Für doc und pdf ist dies in Ordnung.

$allowedExts = array("pdf", "doc", "docx");
$extension = end(explode(".", $_FILES["file"]["name"]));
if ((($_FILES["file"]["type"] == "application/pdf")
|| ($_FILES["file"]["type"] == "application/msword"))
&& ($_FILES["file"]["size"] < 20000000)
&& in_array($extension, $allowedExts))
 {
  if ($_FILES["file"]["error"] > 0)
 {
   echo "Return Code: " . $_FILES["file"]["error"] . "<br>";
 }

Dies ist Teil eines Projekts von vor einer Weile und ich kann mich ehrlich nicht erinnern, wie es gemacht werden soll.

Ich weiß, es ist nicht die sicherste Methode zum Hochladen, aber wenn jemand helfen könnte, wäre es sehr dankbar!

Ich denke, ich muss hier eine weitere Zeile hinzufügen:

if ((($_FILES["file"]["type"] == "application/pdf")
|| ($_FILES["file"]["type"] == "application/msword"))
&& ($_FILES["file"]["size"] < 20000000)

Nur nicht sicher, was .. Hilfe wird geschätzt!

Edit: Also, ich bin an diesem Punkt angelangt (mit Hilfe von Kommentaren!)

$allowedExts = array("pdf", "doc", "docx");
$extension = end(explode(".", $_FILES["file"]["name"]));
//if ((($_FILES["file"]["type"] == "application/pdf")
//|| ($_FILES["file"]["type"] == "application/msword"))
if (($_FILES["file"]["type"] == "application/pdf") 
|| ($_FILES["file"]["type"] == "application/msword") 
|| ($_FILES["file"]["type"] == "application/vnd.openxmlformats-    officedocument.wordprocessingml.document"))
&& ($_FILES["file"]["size"] < 20000000)

&& in_array($extension, $allowedExts))
  {
  if ($_FILES["file"]["error"] > 0)
    {
    echo "Return Code: " . $_FILES["file"]["error"] . "<br>";
    }
  else
    {

Aber jetzt kommt es auf: Parse error: Syntaxfehler, unerwarteter T_BOOLEAN_AND in /var/sites/s/stanation.com/public_html/forms/process/insert.php in Zeile 30

Antworten auf die Frage(3)

Ihre Antwort auf die Frage