Post by fbrother » Fri Aug 01, 2014 4:31 am

Hi...

I'm doing a custom page in frontend with file upload, but no pass data (value from input file) from controller to model
i tried make many way but not succefull

Controller page

if (isset($this->request->files['image']['tmp_name'])) {
$this->data['image'] = file_get_contents($this->request->files['image']['tmp_name']);
} else {
$this->data['image'] = '';
}

Model page

$contact_id = $this->db->getLastId();

if (isset($data['image'])) {
$this->db->query("UPDATE " . DB_PREFIX . "contact SET anexo = '" . $this->db->escape($data['image']) . "' WHERE contact_id = '" . (int)$contact_id . "'");
}

View page

<b><?php echo $entry_anexo; ?></b><br />
<input type="file" name="image" value="<?php echo $image; ?>" />
<?php if ($error_anexo) { ?>
<span class="error"><?php echo $error_anexo; ?></span>
<?php } ?>

I hope a support. thanks for all

Newbie

Posts

Joined
Fri Aug 01, 2014 4:23 am
Who is online

Users browsing this forum: No registered users and 2 guests