Post by hezrou » Mon Feb 04, 2013 12:54 am

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!

Newbie

Posts

Joined
Mon Feb 04, 2013 12:43 am

Post by beattie » Sat Feb 09, 2013 6:35 am

Same problem. For the timebeing, I have commented out the 'Allowed file extension types' and 'Allowed file mime types' code in download.php. Not ideal, but one way around it temporarily.

New member

Posts

Joined
Tue May 22, 2012 11:33 am
Location - Australia

Post by guntis.e » Wed Feb 27, 2013 6:35 pm

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
Image Partneris.lv - opencart web site development and support


Active Member
Online

Posts

Joined
Fri Jan 28, 2011 4:20 am

Post by fabiom7 » Sat Mar 02, 2013 4:05 am

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']);
}
*/

User avatar
Newbie

Posts

Joined
Thu Feb 23, 2012 4:50 am
Location - Italy
Who is online

Users browsing this forum: No registered users and 51 guests