Hello, I was wondering of someone can help me with a problem uploading files for downloadable product.
I have a few issues, but to start I am using Opencart 1.5.5.1 on a fresh install.
I'm trying to start up an ebook store on my site. Files are relatively large, usually 10-15 m. When I try to upload a large file I get the "Upload Required!" error. I contacted my Host (Hostgator) and they set me up with an upload limit of 64m but I still have this error.
I tried uploading smaller files to see if it would work, and it will upload small PDFs, but small zip files I get an error telling me it is an "Invalid File Type!" Are zips not supported by Opencart?
The last issue is that even if I successfully upload a small PDF as a test, when I go to insert a product and associate it with a file, there are no downloadable files visible.
Can anyone help me with these issues? Any help is much appreciated!
I had the same problem. just after some while of exploring the code i found out that the file exension AND file mime type has to be entered. So in System->Settings->Server I entered "zip" as allowed extension and "application/zip" as allowed mime type and - i can upload zip files now!
Guntis
Partneris.lv - opencart web site development and support
I have no time for test
and i have delete the mime types and return to jpg,JPG,txt comma separated.
I have solved with older code of 1.5.4.1
catalog/controller/product/product.php
in
public function upload () {
// Allowed file extension types
replace
$filetypes = explode("\n", $this->config->get('config_file_extension_allowed'));
with:
$filetypes = explode(",", $this->config->get('config_file_extension_allowed'));
some rows below, comment this section:
// Allowed file mime types
/*
$allowed = array();
$filetypes = explode("\n", $this->config->get('config_file_mime_allowed'));
foreach ($filetypes as $filetype) {
$allowed[] = trim($filetype);
}
if (!in_array($this->request->files['file']['type'], $allowed)) {
$json['error'] = $this->language->get('error_filetype');
}
if ($this->request->files['file']['error'] != UPLOAD_ERR_OK) {
$json['error'] = $this->language->get('error_upload_' . $this->request->files['file']['error']);
}
*/
and i have delete the mime types and return to jpg,JPG,txt comma separated.
I have solved with older code of 1.5.4.1
catalog/controller/product/product.php
in
public function upload () {
// Allowed file extension types
replace
$filetypes = explode("\n", $this->config->get('config_file_extension_allowed'));
with:
$filetypes = explode(",", $this->config->get('config_file_extension_allowed'));
some rows below, comment this section:
// Allowed file mime types
/*
$allowed = array();
$filetypes = explode("\n", $this->config->get('config_file_mime_allowed'));
foreach ($filetypes as $filetype) {
$allowed[] = trim($filetype);
}
if (!in_array($this->request->files['file']['type'], $allowed)) {
$json['error'] = $this->language->get('error_filetype');
}
if ($this->request->files['file']['error'] != UPLOAD_ERR_OK) {
$json['error'] = $this->language->get('error_upload_' . $this->request->files['file']['error']);
}
*/
Who is online
Users browsing this forum: No registered users and 51 guests