public function onUploadFileChunk($in, $last = false)
    {
        if ($in->curPart['error'] !== UPLOAD_ERR_OK) {
            // just drop the chunk
            return;
        }
        $cb = function ($fp, $result) use ($last, $in) {
            if ($last) {
                unset($in->curPart['fp']);
            }
            $this->unfreezeInput();
        };
        if ($in->writeChunkToFd($in->curPart['fp']->getFd())) {
            // We had written via internal method
            return;
        }
        // Internal method is not available, let's get chunk data into $chunk and then use File->write()
        $chunk = $in->getChunkString();
        if ($chunk === false) {
            return;
        }
        $this->freezeInput();
        $in->curPart['fp']->write($chunk, $cb);
    }