• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Serious problem with file upload and MS Word docs in IE 7+

#1
[eluser]kelseyads2[/eluser]
I have tried searching the wiki and forums, and have tried several fixes that have not worked.

We have a web application that has a file upload for users to upload their resume. As such, we've allowed doc, pdf and text files with the following config:

Code:
$config['allowed_types'] = 'docx|doc|msword|mswrite|rtf|plain|pdf';

Originally it would not upload Word 2007+ documents at all. We've changed the mime types in the config/mime.php file to the following:

Code:
'docx'  =>  array('application/msword','application/vnd.openxmlformats-officedocument.wordprocessingml.document','application/octet-stream'),

That allows us to upload .doc and .docx files now in FF 3.6 Mac, but in Internet Explorer 7+ on XP and Vista we still cannot upload .docx files at all. We get the following error:

Quote:The filetype you are attempting to upload is not allowed.

This is a serious issue for us on a production site, and I'm catching a lot of heat to get it working. I tried removing the $config['allowed_types'] line hoping it would just allow all filetypes but it threw a different error.

Is there a workaround for this? I'm getting desperate -- I'd even hack the core CI code to get this fixed ASAP.

Any help would be GREATLY appreciated.

#2
[eluser]kelseyads2[/eluser]
Anyone? Are there any official CodeIgniter employees monitoring the forums here? Is there an official support ticket system?

I know we don't pay for the CI framework but we use it on a lot of sites (and pay to use ExpressionEngine on a lot more!). I'd really appreciate if someone could look into this issue and at least acknowledge it here.

Thanks.

#3
[eluser]danmontgomery[/eluser]
You're implying that because some people pay for ExpressionEngine, all Codeigniter users should have access to a support team?

You can see what the MIME type is in $this->upload->data(); (file_type), which is what needs to match up with config/mime.php. What is that value?

#4
[eluser]kelseyads2[/eluser]
[quote author="noctrum" date="1266373158"]You're implying that because some people pay for ExpressionEngine, all Codeigniter users should have access to a support team?

You can see what the MIME type is in $this->upload->data(); (file_type), which is what needs to match up with config/mime.php. What is that value?[/quote]

No I wasn't... I was asking if there were any EE support team members who's job it was to answer CI questions, since they're pretty much both built on CI now (well as of the beta anyway).

And BTW, I would GLADLY pay a license fee to have access to good support. That's one of the reasons we DO have so many EE licenses instead of using other CMS's out there.

The value of the file_type attribute was blank, as were most all of the values in the upload data, like the upload itself failed. But on other file types, it works fine... and on Mozilla/Safari it works fine too.

Thoughts?

#5
[eluser]kelseyads2[/eluser]
Actually, pardon that last remark -- the echo was before the attempted file upload. The file's mime type is 'application/x-zip-compressed' which I'm adding to the list now. Seems like the CI mime types were out of date or something... how often do these things change? How long has Word 2007 been out?

#6
[eluser]danmontgomery[/eluser]
Ehh... data() probably only gets populated on success... Can you check $_FILES['fieldname']['file_type']?

Also, have you checked http://ellislab.com/forums/viewthread/102126/?

#7
[eluser]kelseyads2[/eluser]
[quote author="noctrum" date="1266374695"]Ehh... data() probably only gets populated on success... Can you check $_FILES['fieldname']['file_type']?

Also, have you checked http://ellislab.com/forums/viewthread/102126/?[/quote]

Thanks, I had looked at that, and added those MIME types to my config/mimes.php file but it didn't help.

Adding 'application/x-zip-compressed' to the docx array did solve the problem though. Thank you for pointing out the file_type (mime type) in the array.

I wish there was an easier way to handle file uploads... but am glad it's fixed (until a new version of Word, at least).

Thanks again


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.