Welcome Guest, Not a member yet? Register   Sign In
Upload library - file not uploading - Need help debugging
#1

(This post was last modified: 04-13-2015, 09:23 AM by kabeza.)

Hi guys
I'm having some trouble with the uploading class

My config/upload.php

Code:
$config['upload_path'] = '/home/kike/www/servijus/_files/';
$config['allowed_types'] = 'xls|xlsx|csv';
$config['detect_mime'] = true;
$config['max_size'] = 0;

And I'm "debugging" with these lines in my Excelupload controller

Code:
$this->load->library('upload');
$this->upload->do_upload('excel_asignaciones'); // custom field name
echo "<pre>";
print_r($this->upload->data());
echo "</pre>";
exit();

I guess that If upload->data() is called and the values show fine, file upload was correct, right?
My problem is that I don't see the file in the "_files" folder, which has chmod 777. Also, disabling "detect_mime" config does not work

[Image: aSpH59A.png]

PS: sometimes I get the The filetype you are attempting to upload is not allowed. message but I have this in config/upload.php
Code:
$config['allowed_types'] = 'xls|xlsx|csv|ods';

Update:

Seems an error related to file_type => "application/cdfv2-corrupt" error that can be seen in the image above.
I've created a new excel file from scratch, uploaded, and worked
Just wonder how to solve that application/cdfv2-corrupt thing, because the other xls files can be opened correctly
Reply
#2

This may have something to do with how the file is being created:
https://phpexcel.codeplex.com/discussions/286296

(this link is just an example, several similar results can be found by searching for application/cdfv2-corrupt xls)
Reply
#3

(04-14-2015, 12:04 PM)mwhitney Wrote: This may have something to do with how the file is being created:
https://phpexcel.codeplex.com/discussions/286296

(this link is just an example, several similar results can be found by searching for application/cdfv2-corrupt xls)

That thread you point is the only result I can find, but well, at least I know that the problem is the way that those files are being generated.
The thing is that I thought I could avoid or force the upload without this mime checking, but the only way possible is by setting allowed_types = '*', which is not an ideal thing Undecided
Reply
#4

Set detect_mime to FALSE
Reply




Theme © iAndrew 2016 - Forum software by © MyBB