I am trying to upload files from Postman using PHP API. I’m getting a 403 forbidden error:
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<center>
<h1>403 Forbidden</h1>
</center>
</body>
</html>
Update #2
Update #3
These are the contents of /etc/apache2/apache2.conf
The following lines prevent .htaccess and .htpasswd files from being viewed by Web clients.
<FilesMatch "^.ht">
Require all denied
2
Answers
The key was to Override to allow the AWS-AWSManagedRulesCommonRuleSet rule in AWS WAF for the ALB (application load balancer). Once this rule was overridden, the file upload worked fine!
Check Server Permissions
chmod -R 755 /path/to/upload/directory
chown -R www-data:www-data /path/to/upload/directory
Check .htaccess rules: Check if there are
Deny from all
File upload size limit: on file "php.ini"
upload_max_filesize = 10M
post_max_size = 10M