[Solved] [OJS] PDF not opening and new PDFs are not uploading

I am using OJS

Recently, I changed my server and from then PDFs not opening or new PDFs are not uploading.

Showing below error:
PDF.js v1.8.188 (build: ad1023ff)
Message: stream must have data

This sounds like OJS cannot find your PDF files. Is your files_dir still pointing at your files directory after the server move? Are the permissions correct?


First of all,
Where do I find files_dir ?

And how do I find if it is poiniting at files directory?

It is specified in your OJS config.inc.php file and would have been set when OJS was first installed. You may need your server administrator to confirm file permissions if you do not have access.


I have check in config.inc.php where it is showing
files_dir: /home/journalpharma/files

But inside server I am not able find “files” folder

Hi rajesh,

You should confirm that the files folder was successfully moved over from your old server.


I am sure that all files and folder were moved.

Hi rajesh,

usually, the files_dir points to a directory out side of the www root for security reasons. If you’re sure it was moved, maybe check elsewhere on the server. It could be that the files_dir parameter is not pointing where it should be.


This is location of pdf files…


And in config.inc.php
it is written…
files_dir = /home/journalpharma/files

Is that ok?

Well, no, because the paths are different :slight_smile: The files_dir parameter needs to point at the path where the files are.

files_dir = /var/www/journampharm/homedir/files/


But, make sure that you can’t access the directory directly from a browser, please. It’s a security issue otherwise.

Sir, you are beauty !

Problem solved. Thank you very much for your support.

1 Like

Glad it’s worked out!