At the minute I'm working locally. Just installed FCKEditor on a new drupal installation. I'm using the build in file editor. I tried to upload a .flv file, but i got an error from the filemanager saying "Invalid file type". I've checked in sites/all/modules/fckeditor/fckeditor/editor/filemanager/connectors/php/config.php and the array for allowed extensions for the flash type is ('swf', 'flv'). For info, swf works fine (as does images etc).

where in the code is it looking at for the file type so i can maybe step through it?

thanks

Comments

divillysausages’s picture

Ok, after some digging into it, this is where I get:
In the function FileUpload in sites/all/modules/fckeditor/fckeditor/editor/filemanager/connectors/php/commands.php (around line 175), there's a check for
if ( isset( $_FILES['NewFile'] ) && !is_null( $_FILES['NewFile']['tmp_name'] ) )
before it gets down to the call to see if the extension is valid

If i upload a flv, both of these if checks (isset, is_null) return false, which seems a bit strange, as if i upload a swf, they both come back as true.

sigh, i look further, but if you know where to look at, i'd appreciate the heads up
thanks

Jorrit’s picture

what web server software are you running?

divillysausages’s picture

At the minute I'm running it on localhost, using EasyPHP to set up everything (apache, mysql etc.)
As far as i can tell, it's only the flv that fails (though i haven't tried with a lot of file types).

Where it's failing is in the if check above - both return false for .flv, but true for .swf, even if i do one straight after the other

I traced it further back to upload.php, and everything checks out fine there, until the call to FileUpload(). I'm not sure what's calling upload.php (unless it's just the button press, so I can't go back further)

Jorrit’s picture

does the size of the flv file exceed the maximum upload size of php?

divillysausages’s picture

Status: Active » Fixed

Ah! that works now, thanks Jorrit, that's saved me from taking a faceplant out the nearest window :)
Is there any chance of putting that in as an error message, so you get "file size too big" rather than "invalid file type"?

thanks again

Jorrit’s picture

that would be a good enhancement, but that's something for the fckeditor authors to fix.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.