Hi,
Just setting up the options for our site and when we set up a file upload option it says " Invalid file type!".
Can anyone tell me why this is so? Do I have to put in a setting to allow .jpg files. We tested on very small ones and still not working.
Here s a test page product to see:
http://dev.letterfest.com/index.php?rou ... duct_id=51
Any ideas why the error appears?
Cheers
Bob
Just setting up the options for our site and when we set up a file upload option it says " Invalid file type!".
Can anyone tell me why this is so? Do I have to put in a setting to allow .jpg files. We tested on very small ones and still not working.
Here s a test page product to see:
http://dev.letterfest.com/index.php?rou ... duct_id=51
Any ideas why the error appears?
Cheers
Bob
Hi Again,
Still not found a solution to the customer uploads issue. However I have found the code for it in the system:
catalog/controller/product/product.php
Seems it's a list of file types that are 'allowed' -be great to find out where the list of file types is set?
Also can anyone tell me where the files should be saved to and how we access any successful uploads by customers?
Here is the code for getting the file types allowed to be loaded:
Here is all the code for the upload:
Any ideas chaps?
Many thanks
Bob
Still not found a solution to the customer uploads issue. However I have found the code for it in the system:
catalog/controller/product/product.php
Seems it's a list of file types that are 'allowed' -be great to find out where the list of file types is set?
Also can anyone tell me where the files should be saved to and how we access any successful uploads by customers?
Here is the code for getting the file types allowed to be loaded:
Code: Select all
$allowed = array();
$filetypes = explode(',', $this->config->get('config_upload_allowed'));
Here is all the code for the upload:
Code: Select all
if (isset($this->request->files['file']['name']) && $this->request->files['file']['name']) {
if ((strlen(utf8_decode($this->request->files['file']['name'])) < 3) || (strlen(utf8_decode($this->request->files['file']['name'])) > 128)) {
$json['error'] = $this->language->get('error_filename');
}
$allowed = array();
$filetypes = explode(',', $this->config->get('config_upload_allowed'));
foreach ($filetypes as $filetype) {
$allowed[] = trim($filetype);
}
if (!in_array(substr(strrchr($this->request->files['file']['name'], '.'), 1), $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']);
}
} else {
$json['error'] = $this->language->get('error_upload');
}
if (($this->request->server['REQUEST_METHOD'] == 'POST') && !isset($json['error'])) {
if (is_uploaded_file($this->request->files['file']['tmp_name']) && file_exists($this->request->files['file']['tmp_name'])) {
$file = basename($this->request->files['file']['name']) . '.' . md5(rand());
// Hide the uploaded file name sop people can not link to it directly.
$this->load->library('encryption');
$encryption = new Encryption($this->config->get('config_encryption'));
$json['file'] = $encryption->encrypt($file);
move_uploaded_file($this->request->files['file']['tmp_name'], DIR_DOWNLOAD . $file);
}
$json['success'] = $this->language->get('text_upload');
}
Many thanks
Bob
For me it wasn't quite that easy, I wanted to be able to upload .ico files into the fav-iconuksitebuilder wrote:filetypes are set in:
admin -> system -> settings
Option tab (look near bottom of that page)
Edit file: /admin/controller/common.filemanager.php
First edit the upload() method:
Code: Select all
$allowed = array(
'image/jpeg',
'image/pjpeg',
'image/png',
'image/x-png',
'image/gif',
'image/x-icon',
'application/x-shockwave-flash'
);
Code: Select all
$allowed = array(
'.jpg',
'.jpeg',
'.gif',
'.png',
'.ico',
'.flv'
);
Code: Select all
$allowed = array(
'.jpg',
'.jpeg',
'.png',
'.ico',
'.gif'
);
Advanced Professional Email Template
Customers Pre-Sale. Inc abandoned cart email
Order Follow-Up Email. Inc request review
Email Validation with ZeroBounce
What should the permission be set to? What number? I've tried everything I can;t upload .xml to my site using VQmod. I've updated OC, upadated VQmod, added XML, xml to the admin options and even added it to the admin/controller/common/filemanager.tpl file.
Can someone help me please? I'm trying not to use FTP, it works fine through that but I would like to use the upload feature.
Can someone help me please? I'm trying not to use FTP, it works fine through that but I would like to use the upload feature.
New member
where do the files go once a customer uploads an image? i have been searching and cannot find the directory the holds all uploaded images..
I'm curious to see if you solved this problem?I am having the same issue on OC 1.5.5.1.
Thanks!
Thanks!
Ok I have managed to upload the zip files via FTP to the download folder
I am able to setup the downloads in the admin panel okay and
I tagged them to each products, seems like it's working good.
after I added to cart and make the payment
and go to my download page
It's not downloading, it kept on going and the zip file is only 3MB each
any ideas anyone
I am able to setup the downloads in the admin panel okay and
I tagged them to each products, seems like it's working good.
after I added to cart and make the payment
and go to my download page
It's not downloading, it kept on going and the zip file is only 3MB each
any ideas anyone
SOLUTION
http://forum.opencart.com/viewtopic.php?f=19&t=94873
add mime types:
application/zip
application/x-zip
application/octet-stream [THAT WORKED FOR ME, using WinZip]
application/zip-compressed
application/x-zip-compressed
application/x-compress
http://forum.opencart.com/viewtopic.php?f=19&t=94873
add mime types:
application/zip
application/x-zip
application/octet-stream [THAT WORKED FOR ME, using WinZip]
application/zip-compressed
application/x-zip-compressed
application/x-compress
Hello,
I have a problem for download a file pdf. In system > server i added :
zip
pdf
rar
And in Mime :
application/zip
application/pdf
application/x-rar-compressed
So when i want to add a file pdf in catalog > downloads, it's not work. But for zip it works good.
Somebody do you know why ?
I use opencart 1.5.5.1.
Thanks
I have a problem for download a file pdf. In system > server i added :
zip
rar
And in Mime :
application/zip
application/pdf
application/x-rar-compressed
So when i want to add a file pdf in catalog > downloads, it's not work. But for zip it works good.
Somebody do you know why ?
I use opencart 1.5.5.1.
Thanks
Did you read the post directly above yours?Mangostine wrote:Hello,
I have a problem for download a file pdf. In system > server i added :
zip
rar
And in Mime :
application/zip
application/pdf
application/x-rar-compressed
So when i want to add a file pdf in catalog > downloads, it's not work. But for zip it works good.
Somebody do you know why ?
I use opencart 1.5.5.1.
Thanks
Hi I have a problem with PSD file upload.
I am using Version 1.5.5.1 and I have updated mime type in settings part to all known mime types from (http://filext.com/file-extension/PSD):
still getting same message "Invalid file type!"
then also I have updated filemanager.php upload() function with same stuff, no help
what could be solution?
I am using Version 1.5.5.1 and I have updated mime type in settings part to all known mime types from (http://filext.com/file-extension/PSD):
Code: Select all
image/photoshop
image/x-photoshop
image/psd
application/photoshop
application/psd
zz-application/zz-winassoc-psd
then also I have updated filemanager.php upload() function with same stuff, no help
Code: Select all
$allowed = array(
'image/jpeg',
'image/pjpeg',
'image/png',
'image/x-png',
'image/gif',
'image/photoshop',
'image/x-photoshop',
'image/psd',
'application/x-shockwave-flash',
'application/photoshop',
'application/psd',
'zz-application/zz-winassoc-psd'
);
it works now!
this is my Allowed File Mime Types: list now that works:
this is my Allowed File Mime Types: list now that works:
Code: Select all
text/plain
image/png
image/jpeg
image/gif
image/bmp
image/vnd.microsoft.icon
image/tiff
image/svg+xml
image/photoshop
image/x-photoshop
image/psd
image/vnd.adobe.photoshop
application/zip
application/x-zip
application/octet-stream
application/zip-compressed
application/x-zip-compressed
application/x-compressapplication/x-rar-compressed
application/x-msdownload
application/vnd.ms-cab-compressed
audio/mpeg
application/pdf
application/postscript
application/msword
application/rtf
application/vnd.ms-excel
application/vnd.ms-powerpoint
application/vnd.oasis.opendocument.text
application/vnd.oasis.opendocument.spreadsheet
application/photoshop
application/psd
zz-application/zz-winassoc-psd
video/quicktime
video/quicktime
Who is online
Users browsing this forum: No registered users and 363 guests