Page 1 of 2
MimeType Visual Basic
Posted: 23 Jul 2014, 15:14
by derben
Hi,
I have tried to create a link to a *.vbs file in my Joomla 2.5 with Phoca-Downloads.
Now I am struggeling with the mimetypes I have to enter in the backend, to allow the download.
I have tried {vbs=application/vbscript} and {vbs=text/vbscript} but then the browser shows the sourcecode of the vb-script in a browser tab.
But I would like to have a download, with an option to excecute the file.
Any ideas ?
Thanks a lot.
Ben.
Re: MimeType Visual Basic
Posted: 23 Jul 2014, 23:33
by Jan
Hi, the browser should not display the code even you set some mime type
- do you get it in different browsers?
- when you add e.g. txt file, do you get this problem too with text files?
Jan
Re: MimeType Visual Basic
Posted: 24 Jul 2014, 08:05
by derben
I have tried it with IE11 and Firefox 29. Same issue.
And yes, same with *.txt .
Joomla 2.5 with Phoca 2.1.9
Re: MimeType Visual Basic
Posted: 27 Jul 2014, 12:20
by Jan
Can I see the site where this occurs?
Re: MimeType Visual Basic
Posted: 28 Jul 2014, 10:30
by derben
it is an intranet-site.

Re: MimeType Visual Basic
Posted: 30 Jul 2014, 23:41
by Jan
So then the only idea I have is to customize it and disable the checking for the mime type

like it works in Joomla! 3
Jan
Re: MimeType Visual Basic
Posted: 31 Jul 2014, 20:20
by derben
ok, can you give me a hint where i have to change it ?
Thanks !
Re: MimeType Visual Basic
Posted: 02 Aug 2014, 23:07
by Jan
Hi, in Phoca Download 3 there is such function, so this should be similar, the problem is, Phoca Download 3 has other file structure, so this is hard to find.
In Phoca Download 2, it is stored here:
components\com_phocadownload\helpers\phocadownload.php
check the variable: $errorAllowed ... you can set it to false so in fact the file mime type check will be disabled, but all the functionality needs to be tested there (I didn't test it so cannot say, if there is no conflict with other feature but it should not be

)
Jan
Re: MimeType Visual Basic
Posted: 05 Aug 2014, 08:41
by derben
Hi Jan,
in the file it is set to false already:
...
// NO MIME FOUND
$errorAllowed = false;// !!! IF YES - Disallow Downloading
$errorDisallowed = false;// !!! IF YES - Allow Downloading
$errorAllowed = preg_match("/PhocaError/i", $allowedMimeType);
$errorDisallowed = preg_match("/PhocaError/i", $disallowedMimeType);
if ($errorAllowed) {
$msg = JText::_('COM_PHOCADOWNLOAD_WARNFILETYPE_DOWNLOAD');
$app->redirect(JRoute::_($currentLink), $msg);
} else if (!$errorDisallowed) {
$msg = JText::_('COM_PHOCADOWNLOAD_WARNFILETYPE_DISALLOWED_DOWNLOAD');
$app->redirect(JRoute::_($currentLink), $msg);
} else {
...
Re: MimeType Visual Basic
Posted: 05 Aug 2014, 23:06
by Jan
Hi, this is the default value - you always needs to declare the variable - first value of the variable which will change in the time depending of parameters
I am not on my PC to test it, so cannot give clue advice but try to comment the next lines where the variable gets the true or false
Code: Select all
$errorAllowed = false;// !!! IF YES - Disallow Downloading
$errorDisallowed = false;// !!! IF YES - Allow Downloading
//$errorAllowed = preg_match("/PhocaError/i", $allowedMimeType);
//$errorDisallowed = preg_match("/PhocaError/i", $disallowedMimeType);
$errorAllowed = false;
$errorDisallowed = true;