<?php
namespace Yesf\Http;
use Yesf\Yesf;
class File {
private $file;
public function __construct(&$file) {
$this->file = $file;
}
public function getName() {
return $this->file['name'];
}
public function getType() {
return $this->file['type'];
}
public function getPath() {
return $this->file['tmp_name'];
}
public function getSize() {
return $this->file['size'];
}
public function save($path) {
$path = realpath($path);
$res = rename($this->getPath(), $path);
if ($res) {
$this->file['tmp_name'] = $path;
}
return $res;
}
public function getStream() {
return fopen($this->getPath());
}
}