[dancer-users] permission denied when trying to write_file

Gert van Oss gertvanoss at me.com
Thu Feb 20 21:01:26 GMT 2014


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



More information about the dancer-users mailing list