Skip to content

Commit

Permalink
CSV Import Fix (Windows case of unknown file format)
Browse files Browse the repository at this point in the history
  • Loading branch information
abantecart committed Jul 2, 2014
1 parent c6f1a9d commit a12c6e9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions public_html/admin/controller/pages/tool/import_export.php
Expand Up @@ -259,8 +259,9 @@ private function import($file, $action = 'update_or_insert') {
$results = array();
$run_mode = isset($this->request->post['test_mode']) ? $this->request->post['test_mode'] : 'commit';

if ( in_array($file['type'], array('text/csv','application/vnd.ms-excel','text/plain')) ) {

if ( in_array($file['type'], array('text/csv','application/vnd.ms-excel','text/plain','application/octet-stream')) ) {
#NOTE: 'application/octet-stream' is a solution for Windows OS sending unknown file type
#TODO: Need to add test for the file in case of 'application/octet-stream'
$csv_array = $this->handler->CSV2ArrayFromFile($file['tmp_name'], $this->request->post['options']['delimiter']);
$results = $this->handler->importData($csv_array, $run_mode);
$this->cache->delete('*');
Expand Down

0 comments on commit a12c6e9

Please sign in to comment.