edible insects
Oct 01
// local file that should be send to the client
$local_file = 'test-file.zip';
// filename that the user gets as default
$download_file = 'your-download-name.zip';

// set the download rate limit (=> 20,5 kb/s)
$download_rate = 20.5;
if(file_exists($local_file) && is_file($local_file)) {
    // send headers
    header('Cache-control: private');
    header('Content-Type: application/octet-stream');
    header('Content-Length: '.filesize($local_file));
    header('Content-Disposition: filename='.$download_file);

    // flush content
    flush();
    // open file stream
    $file = fopen($local_file, "r");
    while(!feof($file)) {

        // send the current file part to the browser
        print fread($file, round($download_rate * 1024));    

        // flush the content to the browser
        flush();

        // sleep one second
        sleep(1);
    }    

    // close file stream
    fclose($file);}
else {
    die('Error: The file '.$local_file.' does not exist!');
}

written by Share4Mates

Apr 15

Stage.scaleMode = “noScale”;
Stage.align = “TC”; // Top Center
Stage.showMenu = false; //no right click menu

Stage.scaleMode

Availability
Flash Player 6.

Usage

Stage.scaleMode = “value”

Description
Property; indicates the current scaling of the Flash movie within the Stage. The scaleMode property forces the movie into a specific scaling mode. By default, the movie uses the HTML parameters set in the Publish Settings dialog box.

The scaleMode property can use the values “exactFit” , “showAll” , “noBorder” , and “noScale” . Any other value sets the scaleMode property to the default “showAll” .

written by Share4Mates

Apr 15

For all of the people struggling with getting PHP mail() sending to some, but not all, recipients…look no farther. Your solution has been posted here.

It appears PHP-generated emails don’t play nice on Windows mail servers. So, when your mail goes to anyone who uses a Windows mail server (Comcast, gmail, and maybe aol), the recipients won’t get it. UNLESS YOU ADD THE LINE:

<?php

phpini_set(“sendmail_from”, “info@mydomain.com”);

?>

written by IvanJordanov