OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Maximum space for upload directory exceeded.

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

Moderators: jmacgreg, michael, John

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.

Maximum space for upload directory exceeded.

Postby tshore » Wed Nov 28, 2012 1:23 pm

This happens when you try to use the WYSIWYG editor (TinyMCE) to add an image to your site. The plugin that TinyMCE is using is called JBImages. This is a bug - at least in the version of the code that I'm using (OCS 2.3.5). I've seen it reported a few other times, but, because it couldn't be reproduced, no one ever followed up on it.

In this file:

lib/pkp/lib/tinymce/jscripts/tiny_mce/plugins/jbimages/ci/application/controllers/editor.php

on line 174, replace this:

if ($maxUploadDirSize)

with this:

if ($uploadDirSizeExceeded)

Once I fixed the bug, I was thrilled to find out that I still could not upload an image using TinyMCE. The new error was:

The filetype you are attempting to upload is not allowed

This error is thrown by:

lib/pkp/lib/tinymce/jscripts/tiny_mce/plugins/jbimages/ci/system/libraries/Upload.php

in the function is_allowed_filetype().

It was failing the mime type check, and after a bit of debugging, it seemed that continuing would be too much trouble ($this->file_type was messed up, I think), so I just bailed and switched line 584 from:

public function is_allowed_filetype($ignore_mime = FALSE)

to:

public function is_allowed_filetype($ignore_mime = TRUE)
tshore
 
Posts: 266
Joined: Fri Nov 18, 2005 12:48 pm
Location: Hamilton, Ontario

Re: Maximum space for upload directory exceeded.

Postby asmecher » Wed Nov 28, 2012 1:28 pm

Hi Trudy,

Beware that you may have opened up your system for uploads of malevolent files, e.g. PHP scripts. The code you've changed is in a third-party library so I'm not entirely sure of the implications, but it's worth double-checking.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Maximum space for upload directory exceeded.

Postby tshore » Fri Nov 30, 2012 10:35 pm

Alec - your scare tactics caused me to actually stay at this and find the problem - ugh. I can't believe that no one ever debugged this extension before. I mean, it's not a necessary feature, but surely people have tried to use it on a similar system to our server before?

Ok, so in this file:

lib/pkp/lib/tinymce/jscripts/tiny_mce/plugins/jbimages/ci/system/libraries/Upload.php

you need to replace this (around line 1058):

@exec('file --brief --mime-type ' . escapeshellarg($file['tmp_path']), $output, $return_code);

with this:

@exec('file --brief --mime-type ' . escapeshellarg($file['tmp_name']), $output, $return_code);

Will you guys file these two as bugs?
tshore
 
Posts: 266
Joined: Fri Nov 18, 2005 12:48 pm
Location: Hamilton, Ontario

Re: Maximum space for upload directory exceeded.

Postby asmecher » Sun Dec 02, 2012 11:57 am

Hi Trudy,

That's not a scare tactic -- your original change appears at a glance to have deactivated MIME type checking, which strikes me as risky. JBimages is a third-party extension to a third-party extension (TinyMCE) to our software so my knowledge of its internals is doubly limited. I'd suggest checking in with the author of JBImages (http://justboil.me/) to see what his take on your proposed change is.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Maximum space for upload directory exceeded.

Postby TSammy » Sat Aug 31, 2013 11:13 am

Hi,
My problem was the message appearing on the uploading pop-up window, saying "Upload in progress… This is taking longer than usual. An error may have occurred."
I tried those 2-3 steps of TShore (*), but there is no change, I still can't upload anything.

(*)
1-) Editor.php Line174
2-) Upload.php Lines 584 and 1058
TSammy
 
Posts: 16
Joined: Fri Aug 30, 2013 1:34 pm


Return to OCS Technical Support

Who is online

Users browsing this forum: No registered users and 0 guests