Created
July 16, 2018 21:10
-
-
Save mis4s/842b7d215b109e6207da631fcfb20f0e to your computer and use it in GitHub Desktop.
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 | |
$inputHandler = fopen('php://input', "r"); | |
$path = realpath(dirname(__FILE__) . '/upload'); | |
$fileHandler = fopen($path . '/' . 'some-name-file', "a+"); | |
while (true) { | |
$buffer = fgets($inputHandler, 4096); | |
if (strlen($buffer) == 0) { | |
fclose($inputHandler); | |
fclose($fileHandler); | |
break; | |
} | |
fwrite($fileHandler, $buffer); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment