2016-08-02 10 views
2

Ich habe Probleme beim Hochladen einer CSV-Datei in Code-Signierer.CSV-Datei in CodeIgniter 3 hochladen

Ich erhalte die Fehlermeldung:

array(1) { ["error"] => string(64) "The filetype you are attempting to upload is not allowed." } 

Ok !!

aber ich bin Einstellung allowed_types wie folgt aus:

$config['upload_path'] = './uploads/'; 
$config['allowed_types'] = 'csv'; 
$this->load->library('upload', $config); 

und ich habe dies in mimes.php:

'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain'), 

Also irgendwelche Ideen, warum ich immer noch diesen Fehler?

$ _FILES dump:

Array 
(
    [name] => default questions.csv 
    [type] => application/force-download 
    [tmp_name] => /tmp/phpbkXxUd 
    [error] => 0 
    [size] => 5899 
) 
+0

Typ 'Anwendung/force-download' ist ein Problem, Datei ist currpt, es hat kein gültiges Format und MIME-Typ, um CSV-Datei deklariert werden. Wenn Sie 'application/force-download' in die Mimeliste für csv einfügen, wird die Datei hochgeladen. aber noch wird 'application/force-download' aus dem ungültigen Header' content-disposition' hinzugefügt, was eine 'content-disposition: attachment' sein sollte. –

+0

add 'echo $ this-> upload-> display_errors();' und posten der komplette Fehler –

+0

@Spartan Das ist der Fehler, den ich oben auf die Frage geschrieben habe? – frobak

Antwort

0

Versuchen Sie, diese

$ config [ 'allowed_types'] = '*';

Dies sollte funktionieren .Überprüfen Sie auch Ihre upload.php oder mimes.php. Benutze das Neueste.