Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions drivers/ImportDriver_upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public function import($value, $entry_id = null)
$sql = 'SELECT COUNT(*) AS `total` FROM `tbl_entries_data_' . $this->field->get('id') . '` WHERE `file` = \'' . $filename . '\';';
$total = Symphony::Database()->fetchVar('total', 0, $sql);
if ($total == 0) {
$fileData = $this->field->processRawFieldData($value, $this->field->__OK__);
$fileData['file'] = trim($filename);
$fileData['size'] = filesize(DOCROOT . $destination . '/' . $value);
$fileData['mimetype'] = mime_content_type(DOCROOT . $destination . '/' . $value);
$fileData['meta'] = serialize($this->field->getMetaInfo(DOCROOT . $destination . '/' . $value, $fileData['mimetype']));
$fileData = $this->field->processRawFieldData(trim($value), $this->field->__OK__);
$fileData['file'] = trim($value);
$fileData['size'] = filesize(DOCROOT . $destination . '/' . trim($value));
$fileData['mimetype'] = mime_content_type(DOCROOT . $destination . '/' . trim($value));
$fileData['meta'] = serialize($this->field->getMetaInfo(DOCROOT . $destination . '/' . trim($value), $fileData['mimetype']));

return $fileData;
} else {
Expand All @@ -48,11 +48,11 @@ public function import($value, $entry_id = null)
} else {
// File is stored in the CSV, but does not exists. Save it anyway, for database sake:
if (!empty($value)) {
$fileData = $this->field->processRawFieldData($value, $this->field->__OK__);
$fileData['file'] = trim($filename);
$fileData['size'] = filesize(DOCROOT . $destination . '/' . $value);
$fileData['mimetype'] = ''; // mime_content_type(DOCROOT . $destination . '/' . $value);
$fileData['meta'] = serialize($this->field->getMetaInfo(DOCROOT . $destination . '/' . $value, $fileData['mimetype']));
$fileData = $this->field->processRawFieldData(trim($value), $this->field->__OK__);
$fileData['file'] = trim($value);
$fileData['size'] = filesize(DOCROOT . $destination . '/' . trim($value));
$fileData['mimetype'] = ''; // mime_content_type(DOCROOT . $destination . '/' . trim($value));
$fileData['meta'] = serialize($this->field->getMetaInfo(DOCROOT . $destination . '/' . trim($value), $fileData['mimetype']));

return $fileData;
}
Expand Down