.php requested URL not found on server

2.1k Views Asked by At

I'm attempting to create a webpage that allows a user to upload a file from their computer, and then POST it to my server. However, whenever I'm clicking on the "submit" button on my current webpage, it instantly returns

404 Not Found. The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

Here's my HTML form

<form method="POST" enctype="multipart/form-data" action="upload.php">
<input type="file" name="myfile">
<div>
    <input type="submit" name="submit" value="Upload Now">
</div>

Here's my folder structure, if I'm misunderstanding something.

Sorry if this is a really obvious mistake, I'm very new to php

2

There are 2 best solutions below

1
On BEST ANSWER

I'm a moron, I was running my website on flask which doesn't handle php.

1
On

You should put upload.php the directory where this current form file exists or you should provide absolute URL of the upload.php in form action.