[Solved] Can't see PDFs after upgrade to 3.1.1.4

I upgraded 2.4.5 to 2.4.8 to 3.0.2 to 3.1.1.4. The whole process (web based, with debug on, 18 MB of output) took less than half an hour and I received a confirmation of success: (Upgrade of OJS to version 3.1.1.4 has completed successfully. Don’t forget to set the “installed” setting in your config.inc.php configuration file back to On.)

Now, I can see the issues and article abstracts, but when I click on a pdf, it opens a blank page. In my 2.4.5, that pdf page would look like this:

http:/localhost/index.php/atlantis/article/view/5373/pdf_52

In 3.1.1.4 it looks like this:
http://localhost/journal/index.php?journal=atlantis&page=article&op=download&path[]=5373&path[]=pdf_52

Also, if I right click on a pdf and choose “save link as”, it is being saved as “index.htm”.

My “files” directory in config.inc.php is files_dir = “C:/xampp/files”, outside of htdocs.

I read in one of the threads that files after the upgrade should be longer than before, but mine are still looking like this: 357-1718-2-PB.pdf

What do I need to do?

Make sure that the pdf file linked to the article can be found on the file_dir as you configure in config.inc.php file

In config.inc.php, I have files_dir = “C:/xampp/files”.

In 3.1.1.4, if I right click a link to a PDF, I see:
http://localhost/journal/index.php?journal=atlantis&page=article&op=view&path[]=5373&path[]=pdf_52

If I click on it, a blank page opens with the URL of:
http://localhost/journal/index.php?journal=atlantis&page=article&op=download&path[]=5373&path[]=pdf_52

but the location on the hard drive is:
C:/xampp/files/journals/8/articles/5373/public/5373-7543-1-PB.pdf

Hi @Lolekbolek,

That’s an OJS 2.X style filename, which suggests the upgrade process wasn’t able to rename it. The most likely causes are file permissions or an incorrect files_dir when the upgrade was run. You’ll need to re-run the upgrade process on a backup to rearrange the files as needed.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you, @asmecher. I went back to my 2.4.8 snapshot, made sure files and htdocs/journals directories were NOT set to “read-only” and re-ran upgrade to 3.0.2. Now pdf files are longer, just as you said it should happen. I am going to re-upgrade to 3.1.1.4 now and see what happens.

Finally, after upgrading to 3.1.1.4, I can download PDFs! I learned the lesson: triple check that the files are in fact located in the “files_dir” directory listed in config.inc.php and that both “files_dir” and “htdocs/journal” directories have proper permissions. Thank you @asmecher and @satuh1 !

1 Like

Hi @Lolekbolek,

Great, glad to hear it’s working!

Regards,
Alec Smecher
Public Knowledge Project Team

Hi, I have upgraded successfully ojs from 3.1.1-4 to 3.1.2-4 with no errors. But some pdf of articles can be viewed through internet explorer while they can not through chrome. some can be opened through both two browser and some never opened.
Any solution for that?
-my file directory is located out of the root.
-also writable.
-config is also correct.

Please help me.
Best Regards, Mina

Hi @miki_farman,

I’d recommend clearing your caches in all browsers before debugging further, and checking the browser’s error console to see if any errors/warnings appear there.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

It worked fine after clearing caches. Thank you so much.

Regards, Mina

1 Like