Can´t upload custom CSS in OJS 3.0

Hi guys!
I’d like to customize my OJS installation, but every time I tried to load a custom css file (“custom.css”) nothing happens as if file were rejected.

If not possible ¿where I can locate the original css files for editing?

Hi @mouseonthemoon,

It’s best not to modify the built-in CSS files. I’d suggest checking the file permissions on your public directory and its subdirectories – it’s possible that OJS is having trouble saving content there.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks for answer. I’ve checked the permissions y directories and subdirectorios, and the problem persists.

Hi @mouseonthemoon,

Can you describe how you’ve set permissions?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi!
Sure: setting to 777 the permissions to the directory and the subdirectores within, through site’s cpanel.

I am having the same problem (with both style sheet and logo); permissions are 777…quite weird. Error is “no file uploaded or invalid file type”, with whatever I file I try

Hi all,

The system is probably not able to determine what file type your CSS is – it should be text/plain or text/css. Check this FAQ entry on CSS MIME type identification and this one on MIME type detection more generally.

Regards,
Alec Smecher
Public Knowledge Project Team

GOT THE SOLUTION. Though by accident. Logged as the original Administrator, logged out and entered as an another user (with managing role), and found I can upload any file without problem. ¿Admin users restricted to do so?

Hi @mouseonthemoon,

Hmm, that sounds strange – can you try logging in as administrator again and checking if that behavior holds? Are you uploading to the same field in both user cases?

Regards,
Alec Smecher
Public Knowledge Project Team

Doesn’t work for me. Stik have problem with both css and image (logo) file

Hi @simonbakker,

Start with this post, and provide details of what specifically your system was doing, what you tried, and what did/didn’t work.

Regards,
Alec Smecher
Public Knowledge Project Team

Dear Alec,

Not sure if I understand, your link seems to direct me towards the same conversation we are currently posting in.

When I go to settings>website>appearance and try to upload a logo, css, homepage image or favicon, I get the error message:

I am sure the file type is valid, I did select a file and all folder/file permissions are as needed.

regards,

Simon

Hi @simonbakker,

The post I linked to directs you to information on how OJS detects MIME types; some configuration may be needed along those lines.

Regards,
Alec Smecher
Public Knowledge Project Team

Ah, sorry I misunderstood, will check it out! Thanks!

Still working on it. Though, when uploading an article everything goes without problems, no matter what file type is uploaded…

Hi @simonbakker,

That’s to be expected – there’s no MIME type restriction on submission file uploads.

Regards,
Alec Smecher
Public Knowledge Project Team

Alec, thanks for all your help! The problem seems be solved by commenting changing the following in the config file:

[finfo]
;mime_database_path = /etc/magic.mime

e.g. commenting out the mime_database_path variable

So, onwards to the next challenge :wink:

Best regards,

Simon

1 Like

Hi @simonbakker,

Great – glad to hear it’s resolved, and thanks for documenting the solution!

Regards,
Alec Smecher
Public Knowledge Project Team

The config I am using had this commented out by default. I looked at the temp folder for uploads. All of my uploads are in the temp folder even though the message reads “No file uploaded or invalid file type!” as though the upload didn’t happen.
When one of these successfully works, where is it supposed to deposit the uploaded file?

All the best,

Shawn

Hi @dewolfe001,

The upload first goes into the temporary area, then OJS runs some checks on it to determine whether its file type is appropriate. If it is, in the case of CSS, then the file is moved into the public area. I suspect your problem is either with the file type detection, or with the permissions on your public directory or one of its subdirectories.

Regards,
Alec Smecher
Public Knowledge Project Team