Welcome Guest, Not a member yet? Register   Sign In
File Upload works fine on localhost, but not on production server
#1

[eluser]Nuno Simões[/eluser]
I there,

I'm having a problem that is driving me nuts!
I have a form to upload a doc or docx file and another one to upload a pdf file. Both pass on the same method on the same control, only changing the allowed type. They both are stored on the same folder.
The question is that on localhost, everything works just fine, but on production server, the doc or docx files are identified as not allowed types.

The configuration array of the upload file is:
$config['upload_path'] = './abstracts/';
$config['allowed_types'] = 'doc|docx'; or $config['allowed_types'] = 'pdf';
$config['encrypt_name'] = true;
$config['max_size'] = '5120';
$this->load->library('upload', $config);

If I set '*' on the allowed_types for doc and docx, it works just fine, so it seems like a mime type problem on the server.

I've put the line echo $_FILES['userfile']['type']; to give-me the mime type, and the given mime type is on the config file (application/vnd.openxmlformats-officedocument.wordprocessingml.document).

Did anyone ever faced this problem, that can help me with it?

Thanks in advance




Theme © iAndrew 2016 - Forum software by © MyBB