Image upload Invalid Path!

I have a basic PHP page that adds text to a mysql database this was all working fine until I added the option to upload 2 photos when adding a record

I am getting this error when I save the page

and if I open the update_page.php directly i get this error

{“code”:0,“file”:"/var/www/vhosts/domainnamedeleted.com/httpdocs/admin/dmxConnectLib/lib/core/Path.php",“line”:51,“message”:“Invalid Path! “,“trace”:”#0 /var/www/vhosts/domainnamedeleted.com/httpdocs/admin/dmxConnectLib/modules/image.php(32): lib\core\Path::toSystemPath(NULL)\n#1 /var/www/vhosts/domainnamedeleted.com/httpdocs/admin/dmxConnectLib/lib/App.php(195): modules\image->load(Object(stdClass), ‘image’, Array)\n#2 /var/www/vhosts/domainnamedeleted.com/httpdocs/admin/dmxConnectLib/lib/App.php(159): lib\App->execSteps(Object(stdClass))\n#3 /var/www/vhosts/domainnamedeleted.com/httpdocs/admin/dmxConnectLib/lib/App.php(127): lib\App->execSteps(Array)\n#4 /var/www/vhosts/domainnamedeleted.com/httpdocs/admin/dmxConnectLib/lib/App.php(116): lib\App->exec(Object(stdClass), false)\n#5 /var/www/vhosts/domainnamedeleted.com/httpdocs/admin/dmxConnectLib/lib/App.php(94): lib\App->exec(Object(stdClass))\n#6 /var/www/vhosts/domainnamedeleted.com/httpdocs/admin/dmxConnect/api/CMS/Modules/Pages/update_page.php(8): lib\App->define(Object(stdClass))\n#7 {main}”}

Thanks in advance

What are the server action steps? Seems the image processor path you provided is invalid.
Maybe post some screenshot of how the upload and image processing steps are set up.

Hey Teodor, thanks for getting back so fast

These are the steps and an image for each of the properties
wappler-upload-issue-3






Are you sure both upload steps have are executed? And both have a file selected for upload?

sometimes if a user is only changing the text on the page they won’t be uploading a new file in that instance

Is that the case when you see this error?
You need to use some conditional checks for files then, otherwise it will always result in such errors as the path passed will be null.

yes this is the issue, if I upload 2 fresh images it works fine if I just change some text and save it fails

Where would I have to add those conditions?

Well you will need 2 conditions. One for the first file upload and another for the second one.
Add a condition step, use the $_POST variable for the first file input as an expression. Put the upload/resize/save steps for the first image inside the condtion.
Do the same for the second file upload.

Thank you Teodor that’s all working fine now :grinning:

1 Like