0

Hi i have downloadable products in my store. When customer download products except from chrome it's work fine. but when customer downloads products from chrome then it adds "attachment" word like (abc.mp3, attachment). I userd default function of magento for download

$sampleId = $this->getRequest()->getParam('sample_id', 0);
    $sample = Mage::getModel('downloadable/sample')->load($sampleId);
    if ($sample->getId()) {
        $resource = '';
        $resourceType = '';
        if ($sample->getSampleType() == Mage_Downloadable_Helper_Download::LINK_TYPE_URL) {
            $resource = $sample->getSampleUrl();
            $resourceType = Mage_Downloadable_Helper_Download::LINK_TYPE_URL;
        } elseif ($sample->getSampleType() == Mage_Downloadable_Helper_Download::LINK_TYPE_FILE) {
            $resource = Mage::helper('downloadable/file')->getFilePath(
                Mage_Downloadable_Model_Sample::getBasePath(), $sample->getSampleFile()
            );
            $resourceType = Mage_Downloadable_Helper_Download::LINK_TYPE_FILE;
        }
        try {
            parent::_processDownload($resource, $resourceType);
            exit(0);
        } catch (Mage_Core_Exception $e) {
            $this->_getSession()->addError(Mage::helper('downloadable')->__('Sorry, there was an error getting requested content. Please contact the store owner.'));
        }
    }
    return $this->_redirectReferer();
2
  • I think this is just the way the browser displays the download. Aug 31, 2015 at 19:46
  • Could you please add a screenshot where the "attachment" text is added? Aug 31, 2015 at 19:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.