Permission denied means just that. The webserver doesn't have permission to write the file to the directory that you specified.
This is common on ISP web servers where the server runs as nobody and you try to make php write to your home directory.
You should have a place where the server can write info if you need it to. Try doing a chown to nobody on the directory you want the server to have access to. Then maybe make sure that your group still has read write access to that folder.