Error 500 when deleting an Image

I’m following the YOUTUBE WAPPLER tutorial about “Creating an Image Gallery”. All is running pretty well but, when I arrived at video number 21 and I pressed the delete button in the photo (in this case is a button with an “X” ) the following error appears: "Failed to load resource: the server responded with a status of 500 " this refered to server actions file “imgBaixa.php”.

I’ve tested de error through the error file and this is what appears:

code 0
file “/Applications/MAMP/htdocs/Wapgaleries/dmxConnectLib/modules/fs.php”
line 266
message “File doesn’t exist. (/Applications/MAMP/htdocs/Wapgaleries/galeries/11/)”

(This is not true the folder galeries and the gallery name 11 exists)

|trace|"#0 /Applications/MAMP/htdocs/Wapgaleries/dmxConnectLib/lib/App.php(173): modules\fs->remove(Object(stdClass), ‘FotoGranBaixa’)\n#1 /Applications/MAMP/htdocs/Wapgaleries/dmxConnectLib/lib/App.php(107): lib\App->execSteps(Object(stdClass))\n#2 /Applications/MAMP/htdocs/Wapgaleries/dmxConnectLib/modules/fs.php(51): lib\App->exec(Object(stdClass), true)\n#3 /Applications/MAMP/htdocs/Wapgaleries/dmxConnectLib/lib/App.php(173): modules\fs->exists(Object(stdClass), ‘fileExists1’)\n#4 /Applications/MAMP/htdocs/Wapgaleries/dmxConnectLib/lib/App.php(137): lib\App->execSteps(Object(stdClass))\n#5 /Applications/MAMP/htdocs/Wapgaleries/dmxConnectLib/lib/App.php(107): lib\App->execSteps(Array)\n#6 /Applications/MAMP/htdocs/Wapgaleries/dmxConnectLib/lib/App.php(72): lib\App->exec(Object(stdClass))\n#7 /Applications/MAMP/htdocs/Wapgaleries/dmxConnect/api/Imatges/ImgBaixa.php(8): lib\App->define(Object(stdClass))\n#8 {main}"|

What are your server action steps? And what expression have you added in the delete step?

Here you have the code of the server action ImgBaixa.php trying to delete Images and records in the database this part (deleting records in database) works perfectly but the server can’t find the images.

Please post a screenshot of your server action steps, don’t post hundreds of lines of PHP code in the forum.

1rst. if file exists path: /galeries/{{$_POST.imageGalleryID}}/{{$_POST.imageFile}}
1rst. file remove path: /galeries/{{$_POST.imageGalleryID}}/{{$_POST.imageFile}}

2nd. if file exists path: /galeries/{{$_POST.imageGalleryID}}/thumbs/{{$_POST.ImageFile}}
2nd. file remove path: /galeries/{{$_POST.imageGalleryID}}/thumbs/{{$_POST.imageFile}}

This error says that the file does not exists, which probably means {{$_POST.imageFile}} does not return anything.