# Upload directory security
# Prevent direct access to uploaded files
<Files "*">
    Require all denied
</Files>

# Only allow access to upload handler
<Files "upload_handler.php">
    Require all granted
</Files>

# Set upload limits
php_value upload_max_filesize 500M
php_value post_max_size 500M
php_value max_execution_time 600
php_value max_input_time 600

# Prevent script execution in uploads directory
<Directory "uploads">
    php_flag engine off
    <Files "*">
        Require all denied
    </Files>
</Directory>

# Enable CORS if needed
<IfModule mod_headers.c>
    Header always set Access-Control-Allow-Origin "*"
    Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS"
    Header always set Access-Control-Allow-Headers "Content-Type"
</IfModule>
