PHP-icon

PHP – Algorithm to Create a Large Dummy File in Server

In any case if you want to create a large dummy file in your server for any testing purpose, use the below code to generate in instantly.

For this just create a dummy php file in your server, for eg. dummy-create.php. Then add the following content to it.

$f = fopen('dummy-file', 'wb');
fseek($f, 2 * 1000 * 1000 * 1000, SEEK_SET);
fwrite($f, 'after 2 GB');
fclose($f);

Now run the newly created php file in your browser. eg :
http://yourdomain.com/dummy-create.php

Now a new dummy file named dummy-file with provided size will be created in the same folder of your server. Here 2GB file will be created since the size here described as “2 * 1000 * 1000 * 1000” which is 2GB.

Previous Post
skype-web-version-update

Skype Upgrades Web Version with Mobile and Landline Call Options

Next Post
Whatsapp-message-encryption

WhatsApp Implemented End-to-End Encryption by default for its 1 Billion Users

Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *