File upload in Magento

File upload in Magento

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!

You made it all the way down here so you must have enjoyed this post! You may also like:

How To Connect Google Analytics 4 To Magento 2 Bojan Mareljic
Bojan Mareljic, | 36

How To Connect Google Analytics 4 To Magento 2

3 best open-source eCommerce platforms in 2021 Zrinka Antolovic
Zrinka Antolovic, | 8

3 best open-source eCommerce platforms in 2021

eCommerce Returns Management – a simple solution from the Fashion industry Zrinka Antolovic
Zrinka Antolovic, | 12

eCommerce Returns Management – a simple solution from the Fashion industry

45 comments

  1. Hi,

    IS this is default magento feature in 1.9 ? but its not displaying any option to upload in frontend.

    I checked in files your xml code is already present in 1.9

    please help me to find solution.

  2. A more workable and the one which is used widely for file upload in Magento is from FME. It has more advanced features for file attachments and user friendly front and back ends.

  3. 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….

  4. 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

  5. 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

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

  7. 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

  8. 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

  9. 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

  10. 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

  11. 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.

  12. 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.

  13. Hi,

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

    Thanks,
    JAI

  14. 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.

  15. 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 ???

  16. 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

  17. @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.

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

  19. 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

  20. 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.

  21. File upload Custom Option is built in in new Magento 1.3.0. Just released!
    I just tested it, works great 😉

  22. 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?

  23. 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

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

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

    yours sincerely,

    neo

  26. 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.

  27. 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> <s> <strike> <strong>. You may use following syntax for source code: <pre><code>$current = "Inchoo";</code></pre>.

Tell us about your project

Drop us a line. We'd love to know more about your project.