Welcome Guest, Not a member yet? Register   Sign In
word 2007 file uploading failed in CI?
#1

[eluser]Zeeshan Rasool[/eluser]
Hi dear members! i have a problem which is:
i cant upload my word2007 file on server as i update my mime.php file but no effect.
Please any idea. Very Thanks in advance !
My Code for uploading array:
Code:
$config['allowed_types']     = 'pdf|gif|jpg|jpeg|png|bmp|doc|docx|word|dotx|docm';
#2

[eluser]Ben Edmunds[/eluser]
What error are you getting?

How large is the file?

And BTW, happy birthday!
#3

[eluser]Zeeshan Rasool[/eluser]
thanks Ben, actually it doesn't find any file. i put a check
if($_FILES["filename"]["size"])
{
// Not come here..
}
Why it avoid this check .
#4

[eluser]Ben Edmunds[/eluser]
Go ahead and post the whole controller snippet and the view file code.
#5

[eluser]cahva[/eluser]
If I remember correctly, this is an issue how CI checks the mime types. Try to move the doc,docx etc. to the beginning of $config['allowed_types']. This had something to do with checking if the file is a picture and it will fail if its not a picture even if its on the list Smile
#6

[eluser]Craig A Rodway[/eluser]
I also found it useful to add information for MIME types to application/config/mimes.php:

Code:
...
'pptx'    =>     array('application/powerpoint', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'),
'docx'    =>    'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'xlsx'    =>    'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
...
#7

[eluser]Zeeshan Rasool[/eluser]
Thank you all !
Actually its my mime file problem im sure because it doesn't detect that any file is in $_FILE
@Ben, actually i am doing simple i just uploading a file that is docx file
My view code is :
Code:
<input type="file" name="myfile" id="myfile" style="float:left" size="65" />
And in the model i put a check if any file is available in $_FILE then upload it on my location but it even didn't come in that: My model code is
Code:
function upload_file()
{

if($_FILE["myfile"]["size"])
{
  // Here is my uploading code. But it doesn't come in this if condition.
}
}
@cahvaThanks but file type process is in my if condition so it didn't come there
@craig A Rodway : i used it my it make no effect.

In mime.php code is like:
Code:
'doc'    =>    'application/msword',
'docx'    =>    'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'xlsx'    =>    'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'word'    =>    array('application/msword', 'application/octet-stream','application/vnd.openxmlformats-officedocument.wordprocessingml.document'),




Theme © iAndrew 2016 - Forum software by © MyBB