hammadtariq Posted January 8, 2007 Share Posted January 8, 2007 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.mspxBut 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? Quote Link to comment https://forums.phpfreaks.com/topic/33354-mmf-file-extension-upload-problem/ Share on other sites More sharing options...
HuggieBear Posted January 8, 2007 Share Posted January 8, 2007 How about showing us your upload code so we can check it for errors?RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/33354-mmf-file-extension-upload-problem/#findComment-155850 Share on other sites More sharing options...
hammadtariq Posted January 8, 2007 Author Share Posted January 8, 2007 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 Link to comment https://forums.phpfreaks.com/topic/33354-mmf-file-extension-upload-problem/#findComment-155945 Share on other sites More sharing options...
HuggieBear Posted January 8, 2007 Share Posted January 8, 2007 If you echo out $_FILES['upload']['type'] have you definitely copied down the file type correctly?RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/33354-mmf-file-extension-upload-problem/#findComment-155979 Share on other sites More sharing options...
hammadtariq Posted January 8, 2007 Author Share Posted January 8, 2007 [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?RegardsHuggie[/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 Link to comment https://forums.phpfreaks.com/topic/33354-mmf-file-extension-upload-problem/#findComment-156197 Share on other sites More sharing options...
HuggieBear Posted January 9, 2007 Share Posted January 9, 2007 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.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/33354-mmf-file-extension-upload-problem/#findComment-156228 Share on other sites More sharing options...
hammadtariq Posted January 9, 2007 Author Share Posted January 9, 2007 [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.RegardsHuggie[/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! Quote Link to comment https://forums.phpfreaks.com/topic/33354-mmf-file-extension-upload-problem/#findComment-156600 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.