• How can I add more allowed file extensions? 5 0 5 1
Currently:  

Author Topic: How can I add more allowed file extensions?  (Read 347776 times)

0 Members and 2 Guests are viewing this topic.

Offline Xyu BAM

  • Full Member
  • ***
  • Posts: 145
    • View Profile
Re: How can I add more allowed file extensions?
« Reply #15 on: September 20, 2005, 02:15:30 AM »
unfortunetly there are great many different mime types for common extensions, wich may vary on different web servers.
and in some cases it may be different on what system or what program was used to create sertain file...

Offline altaf_sayani

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: How can I add more allowed file extensions?
« Reply #16 on: November 15, 2005, 01:32:32 PM »
Hi,
  I have tried to add AMR format file and this error comes

Error uploading image file: BabyCry.amr
BabyCry.amr: Invalid file type (amr, application/octet-stream)

so I added the mime as u told and it was showing like this

$mime_type_match['amr'] = array("application/octet-stream");

and then i have also made a file with amr.html in templates/default/media/ but facing the same problem in uploading the AMR format file coming this error even

Error uploading image file: BabyCry.amr
BabyCry.amr: Invalid file type (amr, application/octet-stream)

plz help me in this problem.

Thanks & Regards.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How can I add more allowed file extensions?
« Reply #17 on: November 15, 2005, 02:35:33 PM »
did u add amr extension in the settings?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline altaf_sayani

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: How can I add more allowed file extensions?
« Reply #18 on: November 16, 2005, 12:44:25 PM »
yes I have got it that I was forget to add the AMR extension in setting.

Thanks.

Offline TXtaholic

  • Jr. Member
  • **
  • Posts: 67
  • life is ours we live it our way!
    • View Profile
    • i MMS u
Re: How can I add more allowed file extensions?
« Reply #19 on: November 20, 2005, 04:24:56 PM »
Hi there

well i followed the steps in how to add a new file exrension in my case it was 3gp!!! which works fine if i add a 3gp file via ftp and then add it from admin thru check new images but as a user it still giving me the invalid error message so can u lead me thru please in how to fix that?

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: How can I add more allowed file extensions?
« Reply #20 on: November 20, 2005, 05:34:32 PM »
did u add the extension in the settings?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How can I add more allowed file extensions?
« Reply #21 on: November 20, 2005, 06:52:19 PM »
it still giving me the invalid error message
I bet that's NOT the EXACT message it shows you.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline TXtaholic

  • Jr. Member
  • **
  • Posts: 67
  • life is ours we live it our way!
    • View Profile
    • i MMS u
Re: How can I add more allowed file extensions?
« Reply #22 on: November 22, 2005, 08:18:34 AM »
did u add the extension in the settings?

well here's what i did exactly
 in includes/upload_definitions.php
i added the following
Code: [Select]
$mime_type_match['3gp'] = array("video/quicktime");
and then i created html templates 3gp.html and i added that to media folder in my default template
and here's its code
Code: [Select]
<!-- Template file for 3GPP Files --><OBJECT id=JavaPlug0 height=280 width=300 classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA>
              <PARAM NAME="SRC" VALUE="{media_src}"><PARAM NAME="CONTROLS" VALUE="ImageWindow,ControlPanel">
              <param name="_ExtentX" value="7938">
              <param name="_ExtentY" value="7408">
              <param name="AUTOSTART" value="1">
              <param name="SHUFFLE" value="0">
              <param name="PREFETCH" value="0">
              <param name="NOLABELS" value="0">
              <param name="LOOP" value="0">
              <param name="NUMLOOP" value="0">
              <param name="CENTER" value="0">
              <param name="MAINTAINASPECT" value="0">
              <param name="BACKGROUNDCOLOR" value="#000000">
                </BODY><!--webbot bot="HTMLMarkup" endspan --></HTML></OBJECT>
and also i added 3gp.gif to icon folder
and from settings  in the Valid file extensions  i added 3gp near jpg

it still giving me the invalid error message
I bet that's NOT the EXACT message it shows you.
here's what i'm getting exactly
Error uploading image file:
24.3gp: Invalid file type (3gp, )


anyways here's the url to the copy that i have i'd appreciate if u can check it
http://www.immsu.com/4images/






click on thumb to enlarge


thanks for ur support
:)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How can I add more allowed file extensions?
« Reply #23 on: November 22, 2005, 02:58:21 PM »
Next time please search, this has been discused and answered before!
Code: [Select]
$mime_type_match['3gp'] = array("video/quicktime",""," ");
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: How can I add more allowed file extensions?
« Reply #24 on: December 03, 2005, 03:42:07 AM »
3) Open templates/<your templates>/media/ folder. Make sure you have a template with name of your new extension. (in our example there should be mp3.html template)
    If there is none, then create one. I can not tell you what should be inside that template, because every extension must be handled differently, but you can look in other templates and see how they done it.
Hi! I did it with .rar, .doc and .ace extensions.. and they are working correctly, but i donīt want to show {media_icon} in the site of the download (I look zip template),   i would like to show the thumbnail image from the file. Do you understand to me? how could i do it?
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How can I add more allowed file extensions?
« Reply #25 on: December 03, 2005, 04:04:11 AM »
Apperently 4images does not support this... :?
I'll see if this could be changed though...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: How can I add more allowed file extensions?
« Reply #26 on: December 03, 2005, 04:13:48 AM »
then will you create a mod?  I tried it ... but when it put {thumbnail}  the site show the random thumbnail  :?
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How can I add more allowed file extensions?
« Reply #27 on: December 03, 2005, 04:20:51 AM »
Ok, here is a quick and dirty fix:
in includes/functions.php find:
Code: [Select]
    "thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link),Comment it out or remove it.
Then scroll up a few lines untill you find:
Code: [Select]
  $site_template->register_vars(array(Insert above:
Code: [Select]
  $site_template->register_vars(array(
    "thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link),
  ));
Now you should be able use {thumbnail} tag in the media templates.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: How can I add more allowed file extensions?
« Reply #28 on: December 03, 2005, 04:25:10 AM »
wow!!! it works!!! thank you a lot!!!  :lol:
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: How can I add more allowed file extensions?
« Reply #29 on: December 03, 2005, 04:32:01 AM »
i have another question... i would like to show the URL to the autor in the media templates for .gif and .jpg extensions. And only show the url to the author, which would be the condition so that it worked?
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more