I created the custom option for file upload, If i choose the file and click the upload button i want to upload file, i don't know how to do this customoption

In Magento if choose the file and click the add to cart button file uploaded but I don't want this functionality.so what i need is if I click the upload button after choose the file, i want to upload the file. this is my code.


             var imgVal = $jq('.choose').val();
            return false;
                $jq( "#myProgress" ).removeClass( "hide-progress" ).addClass( "add-progress" );



function move() {
  var elem = document.getElementById("myBar");
  var width = 10;
  var id = setInterval(frame, 10);
  function frame() {
    if (width >= 100) {
    } else {
      elem.style.width = width + '%';
      document.getElementById("label").innerHTML = width * 1  + '%';


can you please help..


You can use the below code in your controller action to upload the file:

 if (isset($_FILES['file']['name']) and (file_exists($_FILES['file']['tmp_name']))) {
            $uploader = new Varien_File_Uploader('file');
            $path = Mage::getBaseDir('media') . DS;
            $uploader->save($path, $_FILES['file']['name']);
            $filename = $_FILES['file']['name'];
  • I added some code in my question.please help Feb 15 '17 at 4:01
  • I have provided the code to upload file. To implement progress bar you will find lot of reference from google. Feb 15 '17 at 5:33
  • After I upload the file,I want show that file in cart page and ordered that product,I want to show that file in admin page.I removed the upload file Fuctionality from file.php please help Feb 24 '17 at 12:08

well native magento wont provide by the default that feature.

you can intigrate third party libraries for that just like plUpload

so use that kind of library.

Not the answer you're looking for? Browse other questions tagged or ask your own question.