Project

General

Profile

Actions

Bug #2728

closed

X-Sendfile corrupted files [user-error]

Added by borconi about 8 years ago. Updated almost 8 years ago.

Status:
Invalid
Priority:
Normal
Category:
mod_fastcgi
Target version:
-
ASK QUESTIONS IN Forums:

Description

I'm trying to create some zip files on the go and use X-sendfiles to download them, here is the relevant script I used:

exec("/usr/bin/zip -qj0 $tmp_file $mylist");
header("X-LIGHTTPD-send-file: $tmp_file" . ".zip");
exit();

However the downloaded file was always smaller than the one on the server. I have tried, using:

header("X-Sendfile2: $tmp_file" . ".zip 0-");

but same result. To get it working I needed to add the file size header, like:

exec("/usr/bin/zip -qj0 $tmp_file $mylist");
header("Content-Length: ".filesize($tmp_file.".zip"));
header("X-LIGHTTPD-send-file: $tmp_file" . ".zip");
exit();

My understanding of X-Sendfile was that we do not need to specify anything form the script since the WebServer will take care of it all. If I'm wrong apologies for raising the issue, but if I'm right there might be a slight bug somewhere.

Lighttpd version: 1.4.33
Server: Ubuntu 14.04
FastCGI: PHP-FPM 5.5.9
Opcance: Disabled
Spawn: Not installed

Actions #1

Updated by gstrauss about 8 years ago

  • Status changed from New to Invalid

Please ask your question in the support Forum (see the Forum tab at the top of this page)

Your script is incomplete. It looks like Perl. If so, then exec() is not what you want to use in your script. Try system() instead.

No further updates here. Please direct your questions to the forums.

Actions #2

Updated by gstrauss about 8 years ago

  • Subject changed from X-Sendfile corrupted files to X-Sendfile corrupted files [user-error]
Actions #3

Updated by stbuehler almost 8 years ago

  • Target version deleted (1.4.x)
Actions

Also available in: Atom