Invalid file path specified when uploading file via api

64 views
Skip to first unread message

Adam

unread,
Sep 15, 2022, 7:44:22 PM9/15/22
to ResourceSpace
Just updated our server to resource space v10 and PHP to 8.1. 

Getting this "Invalid file path specified" error when uploading a file from the local filesystem after the updates.

The function upload_file() in "include/image_processing.php" doesn't seem to be getting the valid upload paths array from my config.php.

in our config.php we have
$valid_upload_paths = array('/data/temp');

I added some debug() steps to upload_file(), and it never checks the path specified in the array from the config.

I edited the upload_file() function in image_processing.php and replaced

$valid_upload_paths = $valid_upload_paths ?? [];
with
$valid_upload_paths = array("/data/temp");

Now the uploads are working again.  Is this a bug in the new version?  Not sure why it's not getting the variable from the config file...

Yang Yangqiusheng

unread,
Mar 17, 2024, 6:54:46 AMMar 17
to ResourceSpace
Hi, Adam
I faced the same problem, and not solved yet. I use rs V10
Can you give me some instructions?

Marc

unread,
Apr 19, 2024, 12:04:07 PMApr 19
to ResourceSpace
I've experienced several issues with PHP 8.1+. Try rolling back to PHP 8.0.x and see if that fixes your problem.
Reply all
Reply to author
Forward
0 new messages