Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I have a droplet and a website in /var/www/html/
index.html:
<!DOCTYPE html> <html lang=“en”> <head> <meta charset=“UTF-8”> <title>PHP File Upload</title> </head> <body> <form action=“fileUploadScript.php” method=“post” enctype=“multipart/form-data”> Upload a File: <input type=“file” name=“the_file” id=“fileToUpload”> <input type=“submit” name=“submit” value=“Start Upload”> </form> </body> </html>
and fileUploadScript.php:
<?php $currentDirectory = getcwd(); $uploadDirectory = “/uploads/”;
$errors = []; // Store errors here $fileExtensionsAllowed = ['ttf']; // These will be the only file extensions allowed $fileName = $_FILES['the_file']['name']; $fileSize = $_FILES['the_file']['size']; $fileTmpName = $_FILES['the_file']['tmp_name']; $fileType = $_FILES['the_file']['type']; $fileExtension = strtolower(end(explode('.',$fileName))); $uploadPath = $currentDirectory . $uploadDirectory . basename($fileName); if (isset($_POST['submit'])) { if (! in_array($fileExtension,$fileExtensionsAllowed)) { $errors[] = "This file extension is not allowed. Please upload a .ttf file"; } if ($fileSize > 16000000) { $errors[] = "File exceeds maximum size (16MB)"; } if (empty($errors)) { $didUpload = move_uploaded_file($fileTmpName, $uploadPath); if ($didUpload) { echo "The file " . basename($fileName) . " has been uploaded"; } else { echo "An error occurred. Please contact the administrator."; } } else { foreach ($errors as $error) { echo $error . "These are the errors" . "\n"; } } }?>
so when someone visits my website he can upload a file on my webserver (droplet) but and error appears “405 Not Allowed nginx/1.18.0 (Ubuntu)”. How can I fix this???
ebeecroft
Noor Bakkal
384d3f11289345379905a243f7b817
IsaacMvd
Ervan Agus
Teckno
dc1bce8262314f84b368813178d9e4
gerard
gerard
Stan Flint