Jump to content

Recommended Posts

Posted

I can't find the answer to this question anywhere.

Am I able to specify what type of files the user can upload in their posts? I have allowed them to upload and, set the file size limits. I want to know what file types that can be uploaded and how to change (limit or add) the file types that are allowed.

 

Any thoughts???

Posted (edited)

Open the Admin panel in IPB. Select System Setting --> Topics, Posts & Polls.

 

Look for Valid postable image extensions and add to the existing extensions.

 

Defaults are: gif,jpeg,jpg,png

 

That should do it. :)

Edited by TCH-Bruce
Posted

I tried that, still no luck. Get this message:

 

THE FOLLOWING ERROR(S) WERE FOUND

You cannot upload this type of file

 

I was trying to allow a user to upload an mp3 file. Are those extension just for images or all files? It says postable images.

Posted

You know I tried uploading an EXE file to my board and I got the same error. But it will take a ZIP file. I'll do more research to see if it can be changed to allow different file types. You may be limited to ZIP files since it converts the file to a .ibf extension

Posted

I'll try it out. So as long as the file is zipped, I should be able to upload it if I add zip to the list that you described?

 

Thank you for the fast response.

Posted

This may be due to the fact that portable executables can run arbitrary code (malware or viruses), so IPB may have just blocked them all together for saftey reasons.

 

Besides, the .zip files will be smaller than the uncompressed file, so it is better for you anyway :)

-GG

Posted

I, Like Bruce, am not sure.

mp3 is tyically reserved for download or streaming only, rar is jsut another compression type and PDF is also download only, but takes the adobe reader to view it.

 

Let me look into this as well and I will return with feedback

-GG

Posted (edited)

OK, I found the file that controls the file types. It is called conf_mime_types.php and is located in the root folder of the forum.

 

You should be able to upload PDF and Mp3. The .rar file types are not listed. I suppose you could edit the file if you knew exactly what to put in there.

Edited by TCH-Bruce
Posted (edited)

I have been doing some reading around on the Internet and this seems to be a problem many folks have been having.

I did see this code from that file that makes it appear that it won't work:

 

<?php

 

$mime_types = array(

 

 

// mime allow post img type allow avatar

 

"application/pdf" => array( 1, 'pdf.gif' , 'PDF Document' ) ,

"image/x-png" => array( 1, 'quicktime.gif' , 'PNG Image' ) ,

"video/vivo" => array( 1, 'win_player.gif', 'VIVO Movie' ) ,

"application/x-compress" => array( 1, 'zip.gif' , 'Compressed File') ,

"video/x-msvideo" => array( 1, 'win_player.gif' , 'MS Video' ) ,

"text/html" => array( 1, 'html.gif' , 'HTML Page' ) ,

"audio/x-pn-realaudio" => array( 1, 'real_audio.gif', 'Real Audio File') ,

"image/gif" => array( 1, 'gif.gif' , 'GIF Image' ,1 ) ,

"video/x-ms-wmv" => array( 1, 'win_player.gif', 'Windows Media Video' ) ,

"video/ms-wmv" => array( 1, 'win_player.gif', 'Windows Media Video' ) ,

"audio/x-ms-wma" => array( 1, 'mp3.gif' , 'Windows Media Audio' ) ,

"audio/ms-wma" => array( 1, 'mp3.gif' , 'Windows Media Audio' ) ,

"audio/basic" => array( 1, 'mp3.gif' , 'AU Audio File' ) ,

"video/mpeg" => array( 1, 'quicktime.gif' , 'MPEG Video' ) ,

"image/ico" => array( 1, 'gif.gif' , 'Icon File' ) ,

"application/x-tar" => array( 1, 'zip.gif' , 'TAR Ball' ) ,

"image/x-MS-bmp" => array( 1, 'bmp.gif' , 'BMP Image' ) ,

"image/tiff" => array( 1, 'quicktime.gif' , 'TIFF Image' ) ,

"text/richtext" => array( 1, 'txt.gif' , 'Rich Text' ) ,

"audio/x-realaudio" => array( 1, 'realaudio.gif' , 'Real Audio' ) ,

"application/mac-binhex40" => array( 1, 'stuffit.gif' , 'Mac Binary' ) ,

"audio/x-aiff" => array( 1, 'quicktime.gif' , 'AIFF File' ) ,

"application/x-gzip" => array( 1, 'zip.gif' , 'GZIP File' ) ,

"application/zip" => array( 1, 'zip.gif' , 'ZIP File' ) ,

"application/postscript" => array( 1, 'postscript.gif', 'Postscript' ) ,

"application/msword" => array( 1, 'word.gif' , 'MS Word doc' ) ,

"video/quicktime" => array( 1, 'quicktime.gif' , 'QuickTime Movie') ,

"application/powerpoint" => array( 1, 'apps.gif' , 'PowerPoint Doc' ) ,

"audio/x-wav" => array( 1, 'sound.gif' , 'WAV File' ) ,

"audio/x-mpeg" => array( 1, 'mp3.gif' , 'MPEG Audio' ) ,

"image/jpeg" => array( 1, 'jpeg.gif' , 'JPEG Image' ,1) ,

"application/x-zip-compressed" => array( 1, 'zip.gif' , 'ZIP File' ) ,

"application/octet-stream" => array( 1, 'quicktime.gif' , 'OCTET Stream' ) ,

"text/plain" => array( 1, 'text.gif' , 'Text File' ) ,

"image/pjpeg" => array( 1, 'jpeg.gif' , 'JPEG Image' ,1) ,

);

 

 

?>

 

You might try adding this into the code of that file, but be sure to back up your original:

 

"audio/mp3" => array( 1, 'mp3.gif' , 'MPEG audio' ) ,

Edited by TCH-Glenn
Posted

The array types are very specific apparently. I was reading and saw that there are like 4 different types you need to enter just for rar files.

 

If you know the different types, and what they need to be opened with, you can simply edit the php file to allow for those types.

 

Bruce, my bet would be that you have encountered that level of accuracy that this file requires to operate correctly.

-GG

Posted

Glenn, I was just testing file types for jrsweets. ZIP files are the only types of files I need to upload on my board so I am content. I would have preferred to be able to upload a self extracting ZIP file (EXE) but it wouldn't let me. So I will settle for ZIP.

 

I can get around it by putting the self extracting file inside of a ZIP file. :blink:

Posted

I will instruct everybody just to use zipped files, no biggie. I just thought that there might be an easy way to add new file types. Thanks for all the help guys.

Posted

Bruce,

Gonna use a zipzip? that is definitely the way to go.

 

jrsweets,

the use of the zip files is definitely a better solution. mp3 and other streamable files will send your bandwidth through the roof.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...