I solved it by setting the file permissions correctly.
It works by settings read/write and execute permissions.
sudo chmod -R a+rwx APPNAME/file