Multiple Image uploads in Magento
Posted: November, 30 2009As standard, Magento will not allow two uploads via the custom options panel of a product, simply returning an error in the cart. Here we explain a simple method of allowing this functionality, with just one line of code.
NEW: Magento Progress bar uploader and Lightbox Preview
Standard version
For the standard old version, simply navigate to:
Magento_Folder/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php
Around Line 145
if (!$upload->receive()) {
Change to:
if (!$upload->receive($file)) {
This quickly solved our dual image upload problem in Magento. However we have moved over to a Multiple Image uploader with progress bar, that works on Magento 1.3x and 1.4x. Read more about that here.
Download ammended File.php
Please make a backup of your current File.php both locally and server side.
Related Articles
- 12.04.10: How to rename Joomla admin (0)
- 25.02.10: Linux CPU States and there meaning (0)
- 10.10.09: How to clear dashboard stats in magento (0)
- 21.09.09: Lightbox / Thickbox / Menu disappears behind flash you tube video [fixed] (24)
- 12.10.09: Remove Latest Messages from Magento admin (0)








Comments RSS Feed




Neat, thanks for this; thought I was going to have to pay a developer to build this in!
Go to Top of the page
How do you view and download the uploaded image once it has been attached to an order?
Kind Regards
Stuart
Go to Top of the page
Hi Stuart,
You should be able to view the image in the usual Magento fashion.
The image is uploaded to:
sales/download/downloadCustomOption/id/id#/key…
Once a sale is made you can find a link to the image in:
Admin -> Sales -> Order -> Choose order -> Items Ordered Panel, link to image will be there.
The buyer will also receive an email with their unique link to the image.
Note: It isn’t kept in a flat file directory for security purposes.
Hope this helps
Go to Top of the page
I’m searching for the file but there are no subfolders in /Type. I’m running 1.3.1. Any chance this is somewhere else?
Thanks!
Go to Top of the page
@Garrett: It’s the File.php (file) within the Type (folder) that you need to edit, there are no sub-folders within the Type folder on a default 1.3/1.4 installation.
The File.php (file) is in the same location on 1.3* and 1.4*.
Firstly, check and double check you are looking at the correct folder:
Magento_Folder/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php
If that wasn’t the reason, chances are the file has been removed at some point. Try downloading a new 1.3* file or use one of the following files:
or use the Edited for multiple image uploads Magento, see main article.
Go to Top of the page