Hi,

There would be several possible solutions. Does anyone have them?

This is my guess about the phenomenon,
Mediawiki hands the uploaded file to a command specified as a value of 
MediaWiki internal variable $wgMimeDetectorCommand and receives its result from 
the command.

On Linux (Fedora 8), "file -bi empty_clipart_gallery.oxt" prints 
application/x-zip .

includes/mime.types of MediaWiki installation set should include the following 
line in order to inform requester's Web browser a correct MimeType when a user 
tries to download the file.
application/vnd.openofficeorg.extension oxt

The uploaded file had an extension .oxt, but the command "file -bi" returned 
application/x-zip while MediaWiki expected application/vnd.openofficeorg.extension as 
defined in the file includes/mime.types .
So, they did not match. Therefore, MediaWiki rejected the file saying "The file is 
corrupt or has an incorrect extension. ..."


Just an idea.
In my case with other web based application I have developed, written in PHP, 
it does
 1. First, believe the filename extension that a user gives.
 2. Second, refer to a predefined array to find a way to confirm the content.
    In this case, oxt => use of unzip and look into META-INF/manifest.xml
 3. Third, do unzip -p questioned_file META-INF/manifest.xml and see entries in 
the file
    such as <manifest:file-entry manifest:full-path ="..." 
manifest:media-type="..."/>
    to check if the content is really the one for the extension that the user 
gives.
 4. As the examination passes, determine a proper MimeType and proceed a 
process.

I also have a similar UNIX shell script for MediaWiki of mine, but I don't 
think it has a good enough quality for the OOoMediaWiki.

Regards,
Tora

Bernhard Dippold wrote:
Hi again...

Clayton schrieb:
is there a restriction that hinders me from uploading an extension file
(.oxt) to the wiki?

OXT is included in the array of allowed file extensions.  Are you
getting any specific error message when you try to upload?

Here it is:
Upload warning
The file is corrupt or has an incorrect extension. Please check the file
and upload again.

  There might
be a MimeType validation error that is blocking this one filetype.

I created the extension by using the archive manager on Ubuntu 9.04 and
modified it's extension from .zip to .oxt. The file's properties
describe it's type with "OpenOffice.org Extension
(application/vnd.openofficeorg.extension)".

So MimeType should be ok from my side (at least I hope so)...

I've tweaked the MimeTypes on the Apache2 server side of things.  OXT
was named in the array of allowed filetypes in the MediaWiki, but was
not explicitly defined as a MimeType in the mime.types config file for
apache.  I think that's why the error was showing up.

Try again, and see of the change has had the effect I'm hoping it has.

Unfortunately not :-(

Neither in SeaMonkey nor in a fresh instance of Firefox uploading did work - same error message as above.

I uploaded the file to http://www.familie-dippold.at/OpenOffice.org/empty_clipart_gallery.oxt

If you want to try - please do so.

Best regards

Bernhard

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@website.openoffice.org
For additional commands, e-mail: dev-h...@website.openoffice.org

Reply via email to