garlik-gag / dokuwiki-plugin-odt2dw

Import odt file in dokuwiki page
10 stars 10 forks source link

Wrong file upload #18

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hi, Garlik, Once I update to new version of odt2dw,there are some wrong when uploading odt files.

The error is below:

odt2dw : er_odtFile_format : Wrong file upload. The file is not an odt file : application/octet-stream odt2dw : er_checkUploadResult : Something is wrong with the uploaded file odt2dw : er_pg_dir : Unable to remove the temporary directory : /

My server system is Windows2003, IIS6 , php 5.4.45 drivered by fastcgi.
P.s:It's OK using old version.
Any idea how to fix this?

Best Regards!
garlik-gag commented 8 years ago

Hi, I don't know who it work on a system different than POSIX.

To solve this bug, you should add "application/octet-stream" to the
"plugin»odt2dw»parserMimeTypeAuthorized" attribute in the setting panel.

The er_pg_dir make me confuse. You should update the "plugin»odt2dw»parserUploadDir" attribute to set a valid directory. Perhaps this error disappear by solving the error above.

Best Regards

ghost commented 8 years ago

Hi, Many thanks for your advise at first. I delete below code in action.php,and it works well now.

 // Check the file has an authorized mimetype
    //if ( $this->getConf( 'parserMimeTypeAuthorized' ) != "" && strpos( $this->getConf( 'parserMimeTypeAuthorized' ), $_FILES['odtFile']['type'] ) === false ) return $this->_msg( array( 'er_odtFile_format', $_FILES['odtFile']['type'] ) );

My "plugin»odt2dw»parserMimeTypeAuthorized" attribute is

application/vnd.oasis.opendocument.text application/octetstream(application/octet-stream?)

I think this is the reason why I can't upload my odt file. I'll try it ,Thank you!