.dwg files

Phoca Download - download manager
alvin152
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 08 Dec 2013, 22:09

.dwg files

Post by alvin152 »

I am trying to upload DWG files they are CAD drawing for architects and I keep getting an error when I try to upload them. Can I use DWG files with Phoca Download and how do I go about doing that?

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

Re: .dwg files

Post by Jan »

Hi, just set the dwg file mime type to allowed file types in Options.


possible mime types: application/acad, application/x-acad, application/autocad_dwg, image/x-dwg, application/dwg, application/x-dwg, application/x-autocad, image/vnd.dwg, drawing/dwg

Or disable the checking file feature.
Jan
If you find Phoca extensions useful, please support the project
joomla123lt
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 29 Apr 2009, 21:53

Re: .dwg files

Post by joomla123lt »

I turned of MIME checking for DWG files, so I'm able to upload these files too.
But I want also to have a MIME icon for DWG files.
I figured it out, that MIME icons are stored in media/com_phocadownload/images/mime, but I don't understand, what file name has to be for Phoca Download to automatically pick it up.

I added MIME type {dwg=application/acad} both to upload and download options, and tried to upload icon of size 64 px icon-dwg.pngto 64 folder, but it is not being picked up and this results in displaying empty image next to the file name.
Though icon-pdf.png from the same folder is being picked up just fine.
joomla123lt
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 29 Apr 2009, 21:53

Re: .dwg files

Post by joomla123lt »

Adding all above mentioned MIME types didn't help.
What are the rules for naming icon files?
E.g. I could find icon-spreadsheet.png and icon-presentation.png, but no mentioning of similar types in MIME list of Phoca Download.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: .dwg files

Post by Jan »

Hi, see the file:
administrator\components\com_phocadownload\libraries\phocadownload\file\file.php

method: public static function getMimeTypeIcon

There you can set the extension and its icon.

Jan
If you find Phoca extensions useful, please support the project
joomla123lt
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 29 Apr 2009, 21:53

Re: .dwg files

Post by joomla123lt »

Thank you, Jan.
I added:

Code: Select all

case 'dwg':
    $icon = 'dwg';
break;
and it worked.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: .dwg files

Post by Jan »

Great to hear it.

Jan
If you find Phoca extensions useful, please support the project
Post Reply