Uploading a file to Apache Web Server not working

  file, html, php, xampp

Picture of my path to upload

Trying to upload file to Apache server but not working. I think it is because I can’t write in the upload file or maybe something else. I am not really sure.

This is the snippet from the HTML form to upload the file:

<form enctype="multipart/form-data" action="upload.php" method="post">

  <input type="file" name="file" id="file">
  <input type="submit" id="u_button" name="u_button" value="Upload the file">

This is my PHP code to upload the file to the server:


$location = "upload/".$filename;

    echo "<p>Worked</p>";
    echo "<b>Try again</b>";


Would appreciate any help:)

Source: Ask PHP