T. J. Frazier wrote:
> FYI, I tried uploading a "real" .oxt file: an example from [1]. It
> uploaded just fine. Solving the problem of creating a real .oxt may
> therefore solve the upload problem, too.

Do you mean that the "real" is the condition where the file is strictly
compliant to the chapter "17. Package" of the ODF specification?
http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office

===== cited =====
17.4 MIME Type Stream
If a MIME type for a document that makes use of packages is existing, then the package 
should contain a stream called "mimetype". This stream should be first stream 
of the package's zip file, it shall not be compressed, and it shall not use an 'extra 
field' in its header (see [ZIP]).
The purpose is to allow packaged files to be identified through 'magic number' 
mechanisms, such as Unix's file/magic utility. If a ZIP file contains a stream 
at the beginning of the file that is uncompressed, and has no extra data in the 
header, then the stream name and the stream content can be found at fixed 
positions. More specifically, one will find:
- a string 'PK' at position 0 of all zip files
- a string 'mimetype' at position 30 of all such package files
- the mimetype itself at position 38 of such a package.
=================


Another aspect that might be needed to be taken into account is what
and what version of a UNIX command, which will guess and/or determine
the MimeType of a questioned file, is being used, I guess.

One of the choices would be "file" command which is widely available
in many Linux distributions.

It works well, but it behaves differently among its versions:
(It does not address deficits of the command. At the time when its
source code and magic data was developed, relevant file specification
was not available or not yet considered widely authorized, I think.)

On Fedora 8
$ file -bi sample.odt
application/x-zip

$ file -bi test.zip
application/x-zip

$ file -v
file-4.21


On Fedora 10
$ file -bi sample.odt
application/vnd.oasis.opendocument.text

$ file -bi test.zip
application/zip

$ file -v
file-4.26


Another choice could be a command using "Shared MIME-info."
E.g. "mimetype" from http://search.cpan.org/~PARDUS/File-MimeInfo/


More customized ways could be a choice.
A hand-made shell script that will first ask "file" command to
determine the MimeType. If it returns "zip", then look into the file
in deep to confirm if it looks like an extension of OpenOffice.org.


Anyway, as Clayton mentioned ...

> The MediaWiki guys have mentioned that this is likely related to a known
> bug in MediaWiki with docx etc files:
> https://bugzilla.wikimedia.org/show_bug.cgi?id=18684

Regards,
Tora


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

Reply via email to