Jerome wrote: Hi,
When HikaSerial use the HikaShop trigger to override the download of a (virtual) file ; it takes control of the headers.
And in these headers, I choose to use the one to mark the file as an image ; which makes the browser display it directly and not download it in your hard drive.
But, it would be possible to add an option in the "attach serial" plugin in order to choose the type of the HTTP headers, so you could have a configuration where the download of the file is forced everywhere (in the front-end order, in the backend, in the email).
Regards,
Hi I was able to figure out how to change the type as you suggested now. In the attachserial plugin in the very last function
I wrote the following
Original Code:private function sendHeader($extension) {
$mime = $this->getMime($extension);
if(!empty($mime)) {
header('Content-Type: '.$mime);
return true;
}
return false;
}
}
re-written code:
private function sendHeader($extension) {
$mime = $this->getMime($extension);
if(!empty($mime)) {
header('Content-Type: '.$mime);
header('Content-Disposition: attachment');
return true;
}
return false;
}
}
All i added is this 1 line header('Content-Disposition: attachment');
The problem I am having is it is downloading the html file and and not the actual coupon that is generated from the url how would i write the code to fix this?
I am using a .png as well for my image. I very urgently need at solution for this i have spent like 2 days trying to get this to work.
Thanks,
Josh