PDF turns into a .txt file after uploading in OJS

I have an issue on OJS, Current version:, were when the pdf is clicked on, the browser saves the file with a .txt extension or it opens the file in notepad. If the file is downloaded and right click on the .txt file and open with Adobe reader it opens as a pdf. When I down load the .txt file from the server, the file can also right clicked and open as a pdf. One of our developers has tried to rename the file to a .pdf file. When I click on the article in OJ that corresponds to the file on the server and click on the pdf button, the screen turns white. When the developer renamed it back to the .txt file and I clicked on the PDF icon the screen was back to normal but it still had the .txt file. Has anyone had a similar issue and what might I do fix this.

1 Like

Thanks Stephen for putting this out there.

I think a lot of people would want to know if anyone else has fixed this problem.

Hi all,

I don’t recognize this behaviour as something OJS might do, so I wonder whether it’s not the effect of a custom modification. I’d suggest using a tool like diff to compare your codebase against a stock 3.1.1-4 package and checking for changes that might explain this.

Alec Smecher
Public Knowledge Project Team

Hi Alec,

Thanks for your response. I work with Stephen, who submitted the query, down here in Florida.

I’ve been told that only two modifications were made since the upgrade: One having todo with mail and another to do with section-editors. Neither of which seem relevant here.

As long as I have your attention, maybe you could answer another question :slight_smile:

Another developer, who no longer works here, wrote a Perl script to query the article_files table in the database and check the extension of the filename there with the on the filename on disk. This was on an older version of OJS, 2.4 8, I think.

Anyway, any ideas about what table in the version database would have the file_type etc, like the article_files table had in the older version?

Thanks for taking the time to read this,

Hi @Ned_Stewart,

The article_files table is now submission_files. That script sounds like a good place to start digging…

Alec Smecher
Public Knowledge Project Team