I previously blogged about how to refer uploaded files in Koha ILS here but the other day, I was at my wit’s end why I can’t access this recently recently uploaded file, I am getting this message prompt: “Your search for longHashNameHere was not successful”.
And so I looked at the opac-error.log and saw this line:
opac-retrieve-file.pl: Use of uninitialized value $isdirect in numeric ne (!=) at /usr/share/koha/opac/cgi-bin/opac/opac-retrieve-file.pl line 45
Looked at the opac-retrieve-file.pl line 45, we have this line of code:
if($isdirect != "1"){
Further looking the lines before it, there is this line on public. Going back to my uploaded file by searching it in upload tool:
It turned out, the file isn’t public. Currently (I’m using 19.11.x), there is no way to edit this particular parameter so I had to do this in the mysql backend. Table is “uploaded_files”.
If it’s the first time you will be editing this one, you will get NULL value in public column/field. Since I already edited this part for the purpose of demonstrating it, the value is zero (“0”). Once the value is changed, I am now able to refer that uploaded file in the img src script which I previously blogged here. I have already updated also the blog entry to reiterate that the file should be public.
That’s all, I hope that if you were able to come here due to similar issue, it has helped you resolved your issue. Thanks for reading!