File upload in Magento

Featured Image

Whan of the most enticipated and needed things in Magento is File upload Custom Option. As discussed last year at Magento Forum, it is not completed nor tested.

Now, Magento already have frontend and admin part of file upload option implemented in themes. Since backend part is still missing, understand that this still doesn’t work, however, if you’re interested how it looks, read on ..

Frontend html is found in:
app/design/frontend/default/default/template/catalog/product/view/options/type/file.phtml

Frontend javascript code in:
app/design/frontend/default/default/template/catalog/product/view/options.phtml
(optionFileUpload js object = asynchronous iframe upload)

You can enable file upload custom option if you add:

<file translate="label" module="adminhtml">
	<label>File</label>
	<render>adminhtml/catalog_product_edit_tab_options_type_file</render>
	<types>
		<file translate="label" module="adminhtml">
			<label>File Upload</label>
		</file>
	</types>
</file>

inside node:
config->global->catalog->product->options->custom->groups

in:
app/code/core/Mage/Catalog/etc/config.xml

Now you have new File Upload option that you can add to product!

We are coding module of similar functionality for one of our clients as we speak, but we have our fingers crossed to see this option in next Magento version!

Interested in hiring us?

Have a chat with us. You would be surprised how small changes can make your business even more successful.


About Ivan Weiler

Technical Educator and Consultant

Ivan is a Technical Educator and Consultant. He gained lots of experience managing some of the most complex Magento projects we had at Inchoo.

Read more posts by Ivan / Visit Ivan's profile

38 comments

  1. Hi,
    I want to add a file(Excel/CSV) upload option in magento front end and the functionality of this will be adding products to cart. I mean this file will contain Product SKU and Quantity details. As I upload the file with said details those product will be added to the cart. Please Help….

  2. Hai I am using magento 1.8.1.0. was it support for my version because if i am upload an image from front end
    “Please specify the product’s required option(s)” error occurs guide me to solve this its urgent

  3. hai am trying this if i am upload image am getting Please specify the product’s required option(s). this error help me to fix this issue

  4. Does anyone know where the files goes once customer uploads. Unable to find anywhere… Not even in my backend media folder files.

  5. Hi,

    I want to have a feature where first a customer place an order and then as per selected option, they can upload number of images from their account for that order.

    For example,
    1) Customer purchase process of 10 images at $100
    2) They pay $100 to us
    3) Now in back end, since they have purchased 10 images for this order, they can upload up to 10 images which we as admin can see and work on that.

    Is it possible with magento and if so how?

    Thanks in advance,
    Dyna May

  6. Hi,

    If you are looking to upload files and attach them to a product for display to a user then we have created a plugin that will easily solve this.

    With our plugin you can browse to the file in the backend and attach it to one or more plugins easily. You can upload any file in to Magento (mp3, doc, pdf, wav, xsl, ppt, mov, avi, flx or anything else you can think of).

    You can find the plugin here:
    http://www.magemechanics.com/product-file-uploader-v2.html

  7. Hi,

    Its a bit of an off topic, but would you know of a way to add file attachment to the customer registration ? I’ve managed to add custom fields but I´m struggling a bit with file attachment

    Regards,
    James

  8. Your front end looks interesting but i miss some really important functions.

    Can everybody upload and delete files?
    Or is the upload only possible if the user is logged in?
    Is the uploaded file assigned to the user and the selected product?
    Can i add a description and a title to the uploaded file?
    Do you support a function to read out the uploaded files (a hrefs) on a another position on the product page (like PHP getProduct().getUploadedFiles()) ?

    Cheers
    David

  9. Hi

    i have created form with my custom extension for image uploading it upload image perfectly with magento uploader

    new Varien_File_Uploader('logo')

    but when i edit the form without upload any image it throws error:

    Warning: preg_match() expects parameter 2 to be string, array given in /lib/Varien/Data/Form/Element/Image.php on line 61

    please help if you have any solution for this.

  10. Hi, I wanna add image uploaded functionality on review Form and want to display with each review. Can anyone pls help me on this?

    Thanks in advance.

  11. Hi,

    I want to add image upload functionality on review form. Can you please help me.

    Thanks,
    JAI

  12. I want to set a file upload option in the customer’s My Account dashboard. I want customer to uplaod an image from his login dashboard and that uploaded image can be seen in the admin panel and frontend both.
    If someone knows how to do that or have an idea please help me.
    Thanks in advance.

  13. kiat asked first “I’d like to have an option for customers to upload their pictures of wearing or using the products and placed these along the product images for all to view. Can it be a possibility with this file upload method?”

    Did anybody find a solution meanwhile ???

  14. Hi,
    Thanks for posting this. Does anyone know where does the uploaded files are sent to. In admin under sales>orders it shows he file but cant view it or save it.
    Any help would be appreciated.
    Thanks

  15. @Magento Mechanic, your extension does not do what this page is talking about. Unless I’m wrong, your extension allows files to be uploaded and linked to PRODUCTS. This page is talking about files uploaded and linked to ORDERS. Your extension looks great, but it’s not even close to the same thing. If you coded an extension that lets me upload a file in the backend to link it to an order, I’ll buy it.

    @ron k, the file is linked to the order and there is a link to download it in the backend when you view the order.

  16. Simple question – where is the button to upload images to put on individual pages like the home page?

  17. hi
    i m in very trouble in magento.
    i have upgreaded magento in to 1.3.2.4 version
    and after upgraded it is not shown upload image button and browse file button so please help how can i upload product image
    i have also new version of flash player rather than it is not appear .

    please reply me quick it is very urgent

  18. It works for single file upload option, but not for multiple (if you want to have more than one file upload option).Will upload only first file.

  19. Magento is so powerful,and i have to give up joomla+virtuemart based website and build my online store with magento.

    does magento has CSV bulk upload function?

  20. I can tell you that this functionality will be available with magento v1.3 – also, you will see if you enable the fileupload at the moment that it is going to cause you problems without further modifications.

    Cheers
    Adam
    OnTap Creative
    Tweakmag

  21. I modifiy the xml file as you mentionned but I can’t see any attributes “file upload”.
    I might have done things wrong ?

  22. hello folks,
    Where can i get this option, i really need this fonction to mu futur website.

    yours sincerely,

    neo

  23. This upload method will be primarily used to submit some file along purchasing a product. For your case i suggest independent upload form somewhere on site, couse those people already purchased product.

  24. I’d like to have an option for customers to upload their pictures of wearing or using the products and placed these along the product images for all to view. Can it be a possibility with this file upload method?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <blockquote cite=""> <code> <del datetime=""> <em> <strike> <strong>. You may use following syntax for source code: <pre><code>$current = "Inchoo";</code></pre>.