MimeType Visual Basic

Phoca Download - download manager
derben
Phoca Member
Phoca Member
Posts: 19
Joined: 09 May 2014, 12:23

MimeType Visual Basic

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: MimeType Visual Basic

Post by Jan »

Hi, the browser should not display the code even you set some mime type :idea:

- do you get it in different browsers?
- when you add e.g. txt file, do you get this problem too with text files?

Jan
If you find Phoca extensions useful, please support the project
derben
Phoca Member
Phoca Member
Posts: 19
Joined: 09 May 2014, 12:23

Re: MimeType Visual Basic

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: MimeType Visual Basic

Post by Jan »

Can I see the site where this occurs?
If you find Phoca extensions useful, please support the project
derben
Phoca Member
Phoca Member
Posts: 19
Joined: 09 May 2014, 12:23

Re: MimeType Visual Basic

Post by derben »

it is an intranet-site.

:!:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: MimeType Visual Basic

Post 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 :idea:

Jan
If you find Phoca extensions useful, please support the project
derben
Phoca Member
Phoca Member
Posts: 19
Joined: 09 May 2014, 12:23

Re: MimeType Visual Basic

Post by derben »

ok, can you give me a hint where i have to change it ?

Thanks !
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: MimeType Visual Basic

Post 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 :idea: )

Jan
If you find Phoca extensions useful, please support the project
derben
Phoca Member
Phoca Member
Posts: 19
Joined: 09 May 2014, 12:23

Re: MimeType Visual Basic

Post 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 {
...
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: MimeType Visual Basic

Post 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;
If you find Phoca extensions useful, please support the project
Post Reply