[OJS] Files of this type can not be uploaded (Windows)

I have a problem updating plugin quicksubmit to on windows server, after some reseach I’ve checked tar.exe and folder permission without luck.
When I try “manual” update I can see the tar temp file (actually is the tar.gz file renamed) in c:\windows\temp after clicking “upload file” button but after clicking on “save” button temp file disappears and it shows the “Files of this type can not be uploaded” error message.

when I try “automatic” update it seems it does nothing and I get PHP error
[19-Jun-2020 01:43:10 Asia/Kuwait] PHP Fatal error: Uncaught Error: Call to a member function getProductType() on string in C:\web-sites\xxxx\lib\pkp\classes\plugins\PluginHelper.inc.php:203
Stack trace:
#0 C:\web-sites\xxxx\lib\pkp\controllers\grid\plugins\PluginGalleryGridHandler.inc.php(287): PluginHelper->upgradePlugin()
#1 C:\web-sites\xxxx\lib\pkp\controllers\grid\plugins\PluginGalleryGridHandler.inc.php(236): PluginGalleryGridHandler->installPlugin()
#2 C:\web-sites\xxxx\lib\pkp\classes\core\PKPRouter.inc.php(391): PluginGalleryGridHandler->upgradePlugin()
#3 C:\web-sites\xxxx\lib\pkp\classes\core\PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest()
#4 C:\web-sites\xxxx\lib\pkp\classes\core\Dispatcher.inc.php(143): PKPComponentRouter->route()
#5 C:\web-sites\xxxx\lib\pkp\classes\core\PKPApplication.inc.php(278): Dispatcher->dispatch()
#6 C:\web-sites\xxxx\index in C:\web-sites\xxxx\lib\pkp\classes\plugins\PluginHelper.inc.php on line 203

Could you give me any additional clue or help to find out what’s wrong?, I have severall ojs webs on the same server but only one shows this error, thank you

1 Like

Hi @ojslbc,

Check the configuration of your tar tool in config.inc.php, and make sure that file permissions are set in plugins/importexport (and plugins more broadly) so that OJS is allowed to upload code there.

Alec Smecher
Public Knowledge Project Team

how can i solve this error, i was try many method but not work for me.
i’m on ojs and php 7.2


Hi @pdti_unira,

Can you describe what you tried, and what the result was?

Alec Smecher
Public Knowledge Project Team

Only way out I’ve found is to update windows to server 2019, using built-in tar.exe (c:\windows\system32) seems to be working so far, thank you

1 Like

i want to upgrade plugin from a package which is tar.gz file but unable to succeeded.
and the result “files of this type can not be uploaded”.

Hey guys, I find another solution instead of updating to Windows Server 2019.
“tar for Windows” is no longer a good one. The last update of it was in 2003, and the plugins cannot be processed by such an old version of tar. The version embedded in Server 2019 seems a new one that works well but cannot extract as standalone software.
For guys work with old Windows Server versions, please try libarchive(http://libarchive.org/downloads/libarchive-v3.5.1-win64.zip), and set tar="[the extract dir]\\bin\\bastar.exe". That works for me!

The Hong Kong Polytechnic University

1 Like

Sorry, the set of tar should be “[the extract dir]\bin\bsdtar.exe”

Thanks Gypsop for the answer. The 2003 tar version for windows is not able to “tar -xvf” like the one you are suggesting. There is no need to use doble quotes if you have directory names without spaces.

Best regards

This topic was automatically closed after 6 days. New replies are no longer allowed.