scp -r /Applications/XAMPP/htdocs/keypairfile.pem uploads ec2-user@publicdns:/var/www/html
where uploads is a directory returns Permission denied (publicke
Even if above solutions don't work, check permissions to destination file of aws ec2 instance. May be you can try with- sudo chmod 777 -R destinationFolder/*
sudo chmod 777 -R destinationFolder/*