1 Make sure that the web server can write to the incoming/ dir:
3 sudo chgrp www-data incoming/
4 sudo chmod 775 incoming/
6 Add some access control to the directory:
8 echo "AuthType Basic" >> .htaccess
9 echo "AuthName \"Upload\"" >> .htaccess
10 echo "AuthUserFile \"$PWD/.htpasswd\"" >> .htaccess
11 echo "Require valid-user" >> .htaccess
12 htpasswd .htpasswd upload