Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #19119

Downloading strangeness: downloaded file has no content

Path csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Tim Streater <timstreater@greenbee.net>
Newsgroups comp.lang.php
Subject Downloading strangeness: downloaded file has no content
Date 1 Oct 2022 14:50:40 GMT
Lines 28
Message-ID <jpr2e0Fn0j4U1@mid.individual.net> (permalink)
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding 8bit
X-Trace individual.net QYFwHqg/zfQJwkL+EDU10g4H8K99lN8X8Lt6e76WA+wN7hdR52
Cancel-Lock sha1:tazLAnYjsGhysYI2IRf+P3k442s=
X-No-Archive Yes
User-Agent Usenapp for MacOS
X-Usenapp v1.23/l - Full License
Xref csiph.com comp.lang.php:19119

Show key headers only | View raw


For those requesting that a file be downloaded from my website, having
selected a file (a .zip or a .dmg), the following is then executed:

<font color="#000000">header('Content-Description: File Transfer');</font>
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . basename ($file) .
'"');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize ($file));

ob_clean ();
flush ();
readfile ($file);


For most of the files to be downloaded, this works just fine. But for one of
them, the downloaded file has zero content at the receiver's end: it is zero
bytes long. The file on the server is correct - I can download it using an FTP
client and drag/drop the file off the server and onto my desktop. Then it has
the correct size/content.

Any suggestions as to why this might be?

-- 
HAL 9000:    Dave.  Put down those Windows disks.  Dave.  DAVE!

Back to comp.lang.php | Previous | NextNext in thread | Find similar


Thread

Downloading strangeness: downloaded file has no content Tim Streater <timstreater@greenbee.net> - 2022-10-01 14:50 +0000
  Re: Downloading strangeness: downloaded file has no content "J.O. Aho" <user@example.net> - 2022-10-01 18:47 +0200
    Re: Downloading strangeness: downloaded file has no content Tim Streater <timstreater@greenbee.net> - 2022-10-01 19:44 +0000
      Re: Downloading strangeness: downloaded file has no content "J.O. Aho" <user@example.net> - 2022-10-02 00:18 +0200
      Re: Downloading strangeness: downloaded file has no content "J.O. Aho" <user@example.net> - 2022-10-02 12:14 +0200
        Re: Downloading strangeness: downloaded file has no content Tim Streater <timstreater@greenbee.net> - 2022-10-02 15:57 +0000
  Re: Downloading strangeness: downloaded file has no content Jerry Stuckle <stuckle.jerry@gmail.com> - 2022-10-01 12:57 -0400
    Re: Downloading strangeness: downloaded file has no content Tim Streater <timstreater@greenbee.net> - 2022-10-01 19:48 +0000
      Re: Downloading strangeness: downloaded file has no content Jerry Stuckle <stuckle.jerry@gmail.com> - 2022-10-01 19:13 -0400
        Re: Downloading strangeness: downloaded file has no content Tim Streater <timstreater@greenbee.net> - 2022-10-02 16:01 +0000

csiph-web