Give permission to debian-transmission to write into a www-data directory
Give debian-transmission
write permission on the directory using ACLs:
sudo setfacl -Rm u:debian-transmission:rwX /opt/www
sudo setfacl -Rdm u:debian-transmission:rwX /opt/www
This sets both the current permissions and default permissions (ones inherited by new files/folders).