public function importFromStream($overwrite = true) {
        $target = $this->findDestination($this->_data, $overwrite);
        $input = fopen('php://input', 'r');
        $output = fopen($target, 'w');

        $size = stream_copy_to_stream($input, $output);

        fclose($input);
        fclose($output);

        if ($size <= 0) {
            @unlink($target);

            throw new IoException('No file detected in input stream');
        }

        $this->_file = new File($target);

        return $size;
    }
public function importFromStream($overwrite = true) {
        $target = $this->findDestination($this->_data, $overwrite);
        $input = fopen('php://input', 'r');
        $output = fopen($target, 'w');

        $size = stream_copy_to_stream($input, $output);

        fclose($input);
        fclose($output);

        if ($size <= 0) {
            @unlink($target);

            throw new IoException('No file detected in input stream');
        }

        $this->_file = new File($target);

        return $size;
    }
public function importFromStream ( $ overwrite = true ) { $ target = $ this -> findDestination ( $ this -> _data , $ overwrite ) ; $ input = fopen ( 'php://input' , 'r' ) ; $ output = fopen ( $ target , 'w' ) ; $ size = stream_copy_to_stream ( $ input , $ output ) ; fclose ( $ input ) ; fclose ( $ output ) ; if ( $ size <= 0 ) { @ unlink ( $ target ) ; throw new IoException ( 'No file detected in input stream' ) ; } $ this -> _file = new File ( $ target ) ; return $ size ; }
Copy a file from the input stream into the temp directory and return a File object.
Primarily used for Javascript AJAX file uploads.

@param bool $overwrite
@return bool
@throws \Transit\Exception\IoException
Copy a file from the input stream into the temp directory and return a File object . Primarily used for Javascript AJAX file uploads .