Can't download or view pdf files

I have upgrade the OJS version 2.4.8. It’s work successful but the problem is that I can’t download pdf files and also PDF viewer is not viewed.

Hi @Jigna,

Do you have a URL to your journal where this is visible? Can you double-check your files_dir in the config.inc.php configuration file to ensure that it’s correct?

Regards,
Alec Smecher
Public Knowledge Project Team

Path of files_dir is ok. At present I have upgrade the version on local
system.

Hi @Jigna,

Is it only PDFs that give you trouble, or do other file types (e.g. .DOCX) cause problems?

Regards,
Alec Smecher
Public Knowledge Project Team

I have getting problems with PDF files. In PDF viewer file is not viewed
and also using the link I can’t download the file.

I have solved the problem. In files_dir path, I have use backward slash instead of forward slash. When I change the slash, my problem is solved.
Thanks to all who helped me to solve this problem.

Hi! I have same problem and also check the files_dir. Nothing’s wrong with it. But still can’t view and download. What should I do then?

Hi @kalel,

Can you describe the problem you’re experiencing, and what you’ve checked/tried?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

My problem is similar to @Jigna. PDF viewer won’t view the article and the download’s not working. When I click download, just a blank page. I have checked the files_dir in config.inc.php but it’s correct. Is there another solution?

Hi @kalel,

Have you checked your file permissions?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Yes, I’ve checked it, too. Writable right?

Hi @kalel,

That by itself is not enough to consider; see this FAQ entry.

Regards,
Alec Smecher
Public Knowledge Project Team

I have solved the problem. In files_dir path, I have use backward slash instead of forward slash. When I change the slash, my problem is solved.
Thanks to all who helped me to solve this problem.

Sorry if I sound like a newbie, but where can I access this code?

Hi @caiomelow,

If you’re wondering where to change the files_dir setting, it’s in your OJS configuration file – config.inc.php – in the directory on your web server where OJS was installed.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi

I am facing a similar problem, but I know what is wrong, but don’t how to fix.

Till last thursday (15), all submission files on my journal was stored on:

/var/www/ojs/files/uergs/

But now it is stored on
/var/www/ojs/files/journals/

On my config.inc.php:
files_dir = /var/www/ojs/files

As result all files older then september are on uergs folder, how can I unify it again?
And old issues are showing PDF links, but when I click it, no file is loaded on pdf viewer.
Any hint?

I discovered that my problem is related to this thred: Security issue: Hacking via submission in OJS 2.4.8

I did all recommendations, but I didn’t find out how to unify the folders on system, so I decide to run a rsync between these folders. And I keep the journals as the main dir_file.

I moved all files to a ojsdata outsite webroot and now I think it is safe. I am not the one who installed this instance, so I didn’t know that files was under the webroot.

Best

Israel

Hi @israel.cefrin,

That sounds like a reasonable solution – I suppose you could also do a few find -exec commands to merge the two areas together. Glad to hear you’ve gotten it going.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

Can you give me a example of find -exec to run?

I just ran rsync -Cravzp between folders (I still have both on my local machine for backup, but online just “journals” exists now.

Best
Israel Cefrin

Hi @israel.cefrin,

Sure – these are off the top of my head, so hopefully no major blunders.

If you have /path/to/old-files and /path/to/new-files:

cd /path/to/old-files
find . -type d -exec mkdir "/path/to/new-files/{}" ";"
find . -type f -exec cp "{}" "/path/to/new-files/{}" ";"

The first find command creates necessary directories (there will probably be duplicates, errors can be ignored). The second copies files into them.

Probably not the most elegant solution, but it’s the one that comes to mind first.

Regards,
Alec Smecher
Public Knowledge Project Team