Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 136,053 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,579 people online right now. Registration is fast and FREE... Join Now!




Mime Types... Script Problem

 
Reply to this topicStart new topic

Mime Types... Script Problem, Halp!

Lord Manimal
17 Nov, 2002 - 11:47 AM
Post #1

D.I.C Regular
***

Joined: 7 Apr, 2001
Posts: 413

Baisicly I'm using this filemanager script, and I want it to be able to accept photos, movies etc. By default it only accepts excel/word docs etc. I've modified the mimetypes accordingly, or so I've thought. But it still says that those file types are unaccepted. Take a look at the code and lemme know how you'd do it:

<?php
/*
* Filename: fileman_config.php
* Author: Adam Morton, adam@tux.appstate.edu
* Description: This file contains the configuration variables for the
* fileman module.
*/

/* Directory to store and retrieve uploaded files. Last forward slash is required. */
$upload_directory = "./mod/fileman/files/";

/* Maximum number of files allowed for upload at one time */
$max_batch_upload = 4;

/* Maximum file size in bytes */
$max_file_size = 200000;

/* Allowed file types for upload.
Default array:
$allowed_types = "application/msword, application/vnd.ms-powerpoint, application/vnd.ms-excel, text/plain, application/pdf, application/x-zip-compressed";
Allows:
MS Word Documents, MS Power Point Presentations, MS Excel Documents, Plain Text Files, PDF Documents, and ZIP files.
*/
$allowed_types = "application/msword, application/vnd.ms-powerpoint, application/vnd.ms-excel, text/plain, application/pdf, application/x-zip-compressed";

?>
User is offlineProfile CardPM
+Quote Post

fyrestorm
RE: Mime Types... Script Problem
20 Nov, 2002 - 07:36 PM
Post #2

D.I.C Lover
Group Icon

Joined: 4 Apr, 2002
Posts: 3,103



Thanked: 2 times
Dream Kudos: 228
My Contributions
QUOTE
/* Allowed file types for upload.
Default array:
$allowed_types = "application/msword, application/vnd.ms-powerpoint, application/vnd.ms-excel, text/plain, application/pdf, application/x-zip-compressed";
Allows:
MS Word Documents, MS Power Point Presentations, MS Excel Documents, Plain Text Files, PDF Documents, and ZIP files.
*/
$allowed_types = "application/msword, application/vnd.ms-powerpoint, application/vnd.ms-excel, text/plain, application/pdf, application/x-zip-compressed";


wouldn't you just have to adjust this portion of the code?

here are some image types:

image/bmp
image/x-bmp
image/cmu-raster
image/x-cmu-raster
image/cur
image/x-cur
image/ico
image/x-ico
image/jpeg
image/x-jpeg
image/jpg
image/x-jpg
image/pcx
image/x-pcx
image/pict
image/x-pict
image/png
image/x-png
image/psd
image/x-psd
image/tga
image/x-tga
image/tif
image/x-tif
image/tiff
image/x-tiff
image/xbm
image/x-xbm
image/xpm
image/x-xpm

i don't know what the types for movies would be though....
User is offlineProfile CardPM
+Quote Post

Lord Manimal
RE: Mime Types... Script Problem
2 Dec, 2002 - 05:07 PM
Post #3

D.I.C Regular
***

Joined: 7 Apr, 2001
Posts: 413

I tried that actually, and I had a complete list of common mime types on this computer somewhere, although I'm loathe to find it now. But I ended up scrapping the damn script.
User is offlineProfile CardPM
+Quote Post

fyrestorm
RE: Mime Types... Script Problem
2 Dec, 2002 - 08:11 PM
Post #4

D.I.C Lover
Group Icon

Joined: 4 Apr, 2002
Posts: 3,103



Thanked: 2 times
Dream Kudos: 228
My Contributions
well, at least i tried to help you...
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 05:47PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month