The small app I was creating works ‘perfect’ locally. A folder is scanned for images. The images are listed and a user then can give tags/description to the images. The updates are stored in a ‘yaml-file’ (for now). When deploying it on a server I get: [hit #10]request to POST /edit/0 crashed: write_file 'myImages.yml' - sysopen: Permission denied at... The code of the POST post '/edit/:id' => sub { my $data = get_AoH_imagelist(); my @data = @{$data}; my $id = param('id'); $data[$id]{tags} = params->{tags}; $data[$id]{description} = params->{description}; my $filename = "myImages.yml"; write_file $filename, to_yaml($data); redirect '/data'; }; Just thougth to change the permissions of the file but that didn't work. It has been a long journey. A RESTful service, login with encrypted password. This issue seems to be the last hurdle. Hope someone is able to hint me in a direction to solve this. Thanks, Gert
On 02/20/2014 02:01 PM, Gert van Oss wrote:
The small app I was creating works ‘perfect’ locally.
A folder is scanned for images. The images are listed and a user then can give tags/description to the images. The updates are stored in a ‘yaml-file’ (for now).
When deploying it on a server I get:
[hit #10]request to POST /edit/0 crashed: write_file 'myImages.yml' - sysopen: Permission denied at...
Does the user your web server runs as have write permissions for myImages.yml? For example, I use Apache and on my system the Apache user is 'apache', but on some systems it's 'nobody'. For other web servers it's different.
Thanks for replying. All works perfect. It was my own fault as somewhere I had used: post '/edit/:id' => sub { my $filename = "myImages.yml"; ..... } as opposed to get '/edit/:id' => sub { my $filename = Dancer::FileUtils::read_file_content( Dancer::FileUtils::path( setting('appdir'), 'myImages.yml' ) ); ..... } Gert On 20 Feb 2014, at 22:52, Maxwell Carey <mcarey@ucar.edu> wrote:
On 02/20/2014 02:01 PM, Gert van Oss wrote:
The small app I was creating works ‘perfect’ locally.
A folder is scanned for images. The images are listed and a user then can give tags/description to the images. The updates are stored in a ‘yaml-file’ (for now).
When deploying it on a server I get:
[hit #10]request to POST /edit/0 crashed: write_file 'myImages.yml' - sysopen: Permission denied at...
Does the user your web server runs as have write permissions for myImages.yml? For example, I use Apache and on my system the Apache user is 'apache', but on some systems it's 'nobody'. For other web servers it's different. _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
participants (2)
-
Gert van Oss -
Maxwell Carey