skip to Main Content

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


  1. Chosen as BEST ANSWER

    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!


    1. Check Server Permissions

      chmod -R 755 /path/to/upload/directory

      chown -R www-data:www-data /path/to/upload/directory

    2. Check .htaccess rules: Check if there are Deny from all

    3. File upload size limit: on file "php.ini"

      upload_max_filesize = 10M

      post_max_size = 10M

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search