VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: borro on October 07, 2016, 16:28:15 PM

Title: Why does the component work fine at localhost but don't work at the combat site?
Post by: borro on October 07, 2016, 16:28:15 PM
Hello!

I've developed the Joomla 3.x+VM3.x component(download link (https://cloud.mail.ru/public/HBYK/k8F2rrFCe)) with the access to it from a backend of Joomla. It works fine at localhost but not at the combat server. When I access the component via clicking "Components"->"Get the excel!" at backend I see an error message which tells that:
QuoteCann't get the access to the site
The page https://somesite.com/administrator/index.php?option=com_vmpricelist&view=download probably temporary unaccessible or connstanlty moved to anew address
ERR_INVALID_RESPONSE
I also attach the screenshot of the broken page with the info from a Network tab of Chrome developer toolbar

Please help to understand why it is so.

Thank you!
Title: Re: Why does the component work fine at localhost but don't work at the combat site?
Post by: GJC Web Design on October 07, 2016, 22:30:10 PM
It must be server related.. should an xml be created for download?

perhaps mimetype handling etc.. a good host will be able to help u
Title: Re: Why does the component work fine at localhost but don't work at the combat site?
Post by: borro on October 08, 2016, 08:14:57 AM
Quote from: GJC Web Design on October 07, 2016, 22:30:10 PM
It must be server related.. should an xml be created for download?

perhaps mimetype handling etc.. a good host will be able to help u

Good morning! Thank you.

An excel 2007 file should be created by this component after click at "Download" button at the backend panel. To achieve this such headers are used in view.html.php file:

...
        header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header("Content-Disposition:attachment;filename='document.xlsx'");
        header('Cache-Control: max-age=0');
        $writer = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');
...


I'm using the PHPExcel 1.8.0 to create excel document. As I found out if I change  'Excel2007' with  'Excel5' everything works fine. What is wrong?
Title: Re: Why does the component work fine at localhost but don't work at the combat site?
Post by: GJC Web Design on October 08, 2016, 10:44:08 AM
no idea...  if its server related then ask your host