You are viewing the PKP Support Forum | PKP Home Wiki

Upgraded to OJS 2.1 and Article Download

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

Upgraded to OJS 2.1 and Article Download

Postby lawrence » Thu Feb 23, 2006 10:24 am

Hi there,

After having upgraded OJS from 2.x to 2.1, we found that if we delete and upload articles as Editor, and the articles will not display in a normal way when we click on "HTML". OJS will display the following message :

"Article Download
The file you selected should begin downloading automatically. If it does not, click the link below. Note that this file may require a special viewer or plugin to view.

If the file does not download automatically, click here."

Is it a bug or something that we have overlooked ?
Please advise how to fix the problem?

Posts: 10
Joined: Mon Dec 19, 2005 11:00 am
Location: Edmonton, Canada

Postby asmecher » Thu Feb 23, 2006 12:06 pm

Hello Lawrence,

When you upload a galley, OJS tries to determine the type of file. If it's an HTML galley, it's treated differently from other formats; for example, HTML galleys can have a number of images uploaded along with the submission file. It sounds like your system isn't properly recognizing your HTML files.

OJS determines file types as follows:
  • If the mime_content_type function is available (see http://ca3.php.net/manual/en/function.m ... t-type.php), it is called to determine the type of file (using, in turn, the system's magic.mime file).
  • If mime_content_type is not available, OJS calls the "file" tool on the server as follows:
    Code: Select all
    file -bi [filename here]
  • If the file type couldn't be determined by either means above, the MIME type submitted by the uploading browser, if any, is used.

To check if the file is HTML, OJS checks for the substring "html" in the type as determined using the above steps.

Users have reported in the past that their magic.mime file isn't being located by PHP. Check the mime_content_type link above for information on configuring this function. I'd suggest introducing a couple of debugging statements to print out the results of the various steps above; if you'd like help accomplishing this, feel free to contact me directly at pkp-support@sfu.ca.

Alec Smecher
Open Journal Systems Team
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Upgraded to OJS 2.1 and download file

Postby lawrence » Fri Feb 24, 2006 12:12 pm

Hi Alec,

Some how the magic.mime was corrupted, we replaced it and it works now.

Thanks again
Posts: 10
Joined: Mon Dec 19, 2005 11:00 am
Location: Edmonton, Canada

Postby JasonNugent » Fri Mar 24, 2006 11:37 am

There are other instances when you may upload what you think is an HTML file, but the MIME functions (and the file command) think differently.

The magic.mime system works by looking for strings of text or sequences of characters in your file. If those sequences of characters are not there, you won't get the MIME you expect. We had this situation just recently when we modified our HTML documents and changed the DOCTYPE declaration at the top. Our magic.mime file did not have:

\<!DOCTYPE\ html

It had every other lowercase/uppercase permutation of that, but because it matches it literally, it was casting our HTML documents to text/plain, not text/html.

the solution was to add the line:

Code: Select all
0       string          \<!DOCTYPE\ html        text/html

to the magic.mime file and recompile it with:

file -C -m /usr/share/misc/magic.mime (or where ever your MIME file is).

Then restart apache, since the mimetype extension in PHP only reads this file on startup.


Site Admin
Posts: 910
Joined: Tue Jan 10, 2006 6:20 am

Return to OJS Technical Support

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 2 guests