The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> md5sums of downloaded files are wrong
larry78723
post Mar 8 2022, 10:00 AM
Post #1


Member
***

Group: Members
Posts: 39
Joined: 5-March 20
Member No.: 27,220



I'm having a problem that files downloaded from my site don't have the same md5sum as the original file. Here's an example:

md5sum of original file: a00bd61088cf4f4a0138d51f24e554f0

md5sum of downloaded file: 6f23af927c0a3348345ed1415fb89e36

I suspect that something is inserting bits into the downloads. I've scrubbed the code for hidden spaces but found none.

Here's the code I'm using:
CODE

<?php

function mydloader($filename=NULL)  {
    if( isset( $filename ) ) {        
        $ext = pathinfo($filename, PATHINFO_EXTENSION);
            {
            if ($ext == '.iso')
                header('Content-Type: application/x-cd-image');
            elseif ($ext =='.gz')
                header('Content-Type: application/zip');
            else
                header('Content-Type: octet-stream');
            }
        header('Content-Length: ' .filesize($filename));
        header("Content-Disposition: attachment; filename={$filename}");
        header('Pragma: no-cache');
        header('Expires: 0');        
        readfile($filename);
                  
      }
        
    else {
        echo "isset failed";
        }  
}
mydloader($_GET["f"]);   //passed from calling script


I'd appreciate some help on this.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Christian J
post Mar 9 2022, 04:44 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,665
Joined: 10-August 06
Member No.: 7



What was the cause?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 16th May 2024 - 11:11 PM