Support the ongoing development of Laravel.io →
posted 10 years ago
Requests

Hi all,

so I have a large (1.7mb) jpg file that I want to allow users to download as a screen wallpaper. I am using the following:

/**
* getWallpaper
* Download the wallpaper in jpg format from above web root
* 
* @return file
*/
public function getWallpaper()
{
$file = "../downloads/myfile.jpg";

$headers = array('Content-Type: image/jpeg');

return Response::download($file, 'myfile.jpg', $headers);
}

This works really fast on my local dev server, but takes around 14 seconds for the browser download dialogue box to appear on my production server.

Any ideas? Could be a setting miss-match at the server level, if so what settings should I be looking at?

Thanks for any help.

Ollie.

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

ollie-new ollie-new Joined 20 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.