Jump to content

Recommended Posts

hello,
I am trying to upload .mmf files on my server running Apache.
It neither uploading there nor on my local machine which is running on IIS.

I have a check before uploading and I am adding following lines into the array of allowed file types, I believe this is the correct mime type for mmf files.

'application/x-smaf' => 'mmf',
'application/vnd.smaf' => 'mmf',

IIS dont support mmf, I have to make the entry in supported mime types, so I do by taking help from here:

http://www.microsoft.com/technet/prodtechnol/windows2000serv/technologies/iis/maintain/featusability/mimeiis.mspx

But that doesn't made any difference.

Then I uploaded file on the server and thought that it would work there but seems Apache doesn't aware of it either. Any solution?
Link to comment
https://forums.phpfreaks.com/topic/33354-mmf-file-extension-upload-problem/
Share on other sites

well there is no problem with upload procedure as it is quite fairly uploading other extensions like mp3 and amr.

however below is the array where i store mime types of extensions:

$upload_types = array(  'audio/amr' => 'amr',
'audio/wav' => 'wav',
'audio/mpeg' => 'mp3',
'audio/mpeg3' => 'mp3',
'audio/x-mpeg-3' => 'mp3',
'audio/x-wav' => 'wav',
'audio/midi' => 'midi',
'audio/x-mid' => 'mid',
'application/x-smaf' => 'mmf',
'application/vnd.smaf' => 'mmf',

);

Here I get the type:
        $type=$_FILES["upload"]["type"];
and here I check the whether the uploaded types is in array or not:

if(array_key_exists($type, $upload_types))
{
                          }

All other works fine, problem is only with mmf extension.
[quote author=HuggieBear link=topic=121525.msg499939#msg499939 date=1168283696]
If you echo out $_FILES['upload']['type'] have you definitely copied down the file type correctly?

Regards
Huggie
[/quote]

thanx for the hint Huggie but there comes another problem, on echo it is returning application/octet-stream which is quite ambiguise as I have seen the list which have this mime type and that goes on..means this is same mime type for exe, doc, mmf, lhz, lha etc.

while i m intending to allow only mmf...
is there any solution? how to do it? or why it is behaving like that?
[quote author=HuggieBear link=topic=121525.msg500192#msg500192 date=1168301404]
I see what you mean, that's certainly why it's not uploading it.  I think I'll look into this a bit further for you tomorrow when I get to work, as I had a similar problem myself.

Regards
Huggie
[/quote]

hmm well thanx Huggie in advance..
as far as my perception is concerned I think IIS or windows itself is not recognizing this format as this is not so common, I have seen list of support file formats by IIS, refer to my first post, this format has to be added in IIS by going in Control Panel>Administrative Tools>IIS>Default Website>Properties>HTTP Headers>File Types.

i have added there but its still not working. hope that you will find some solution for it as Apache don't seem to work with it either!
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.