Google Chrome started blocking downloads served via HTTP.
This update broke my download links and shows the console error below.
Mixed Content: The site at ‘https://www.sellmyiphonemiami.com/’ was
loaded over a secure connection, but the file at
redirected through an insecure connection. This file should be served
over HTTPS. This download has been blocked. See
for more details.
My pdf downloads are served over HTTPS but I still get this error.
Heres is my controller:
$filename = sprintf('FedExShippingLable-%s.pdf', $order->getshippingTrackingNumber()); $fs = new Filesystem(); $fs->dumpFile($filename, $order->getshippingDocument()); // Generate response $response = new Response(); // Set headers $response->headers->set('Cache-Control', 'private'); $response->headers->set('Content-type', mime_content_type($filename)); $response->headers->set('Content-Disposition', 'attachment; filename="' . basename($filename) . '";'); $response->headers->set('Content-length', filesize($filename)); // Send headers before outputting anything $response->sendHeaders(); $response->setContent(file_get_contents($filename)); $fs->remove($filename); return $response;
$10,000 to the first person who can solve.
Just kidding but I’ll be eternally grateful.
Source: Symfony Questions
Was this helpful?
0 / 0