jeudi 3 décembre 2015

laravel5 file header (content-length) submits always correct file size

my code at the moment:

 return response()->download(storage_path('app/10mb.test'), 'bla.txt',
    ['Content-Length:' => Storage::disk('local')->size('10mb.test')]
    );

I've used livehttp headers plugin to check if my return works fine, and the correct amount of file size is submitted (I think so from reading http codes). It's strange, the correct filesize is submitted, but when I edit the filesize to sth incorrect like:

 return response()->download(storage_path('app/10mb.test'), 'bla.txt',
    ['Content-Length:' => 'Storage::disk('local')-> '12345']
    );

The correct filesize is submitted too, I can't understand why? Any idea?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire