Created
June 29, 2015 09:45
-
-
Save standa/2b7fc215cbc5f0ae1dfe to your computer and use it in GitHub Desktop.
How to create a 20 MB file quickly in PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** @link https://github.com/google/google-api-php-client/blob/master/examples/fileupload.php */ | |
/************************************************ | |
We'll setup an empty 20MB file to upload. | |
************************************************/ | |
DEFINE("TESTFILE", 'testfile.txt'); | |
if (!file_exists(TESTFILE)) { | |
$fh = fopen(TESTFILE, 'w'); | |
fseek($fh, 1024*1024*20); | |
fwrite($fh, "!", 1); | |
fclose($fh); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment