I am creating a WordPress plugin. I need to open a word document which is already stored on the server.
I have SQL bringing back the location and storing it as $file_loc http://localhost/pjmorris/wp-content/uploads/writingreview/admin/27-1.docx
$zip = new ZipArchive;
$res = $zip->open($file_loc);
echo $res;
Currently, $res is returning 5 which is a read error but I can't work out why. I've got a bit further up in the code to download the document and it downloads as a docx. Is anyone able to help/advise what to try please.