TYPE-0 PERFECT SEIHA
Server Info:
FreeBSD scimitar.blueboard.cz 13.5-STABLE FreeBSD 13.5-STABLE stable/13-4f2925105 GENERIC amd64
Software:
Apache
User:
www
Crot
Crot File
Crot Dir
Crot Command
[LockSelf]
[HOME]
data
www
19068
fszoo_net
addlogo
home
vendor
nette
http
src
Http
Show Hidden Files
Edit File: /data/www/19068/fszoo_net/addlogo/home/vendor/nette/http/src/Http/FileUpload.php
<?php /** * This file is part of the Nette Framework (http://nette.org) * Copyright (c) 2004 David Grudl (http://davidgrudl.com) */ namespace Nette\Http; use Nette; /** * Provides access to individual files that have been uploaded by a client. * * @property-read string $name * @property-read string $sanitizedName * @property-read string|NULL $contentType * @property-read int $size * @property-read string $temporaryFile * @property-read int $error * @property-read bool $ok * @property-read bool $image * @property-read array|NULL $imageSize * @property-read string|NULL $contents */ class FileUpload extends Nette\Object { /** @var string */ private $name; /** @var string */ private $type; /** @var string */ private $size; /** @var string */ private $tmpName; /** @var int */ private $error; public function __construct($value) { foreach (array('name', 'type', 'size', 'tmp_name', 'error') as $key) { if (!isset($value[$key]) || !is_scalar($value[$key])) { $this->error = UPLOAD_ERR_NO_FILE; return; // or throw exception? } } $this->name = $value['name']; $this->size = $value['size']; $this->tmpName = $value['tmp_name']; $this->error = $value['error']; } /** * Returns the file name. * @return string */ public function getName() { return $this->name; } /** * Returns the sanitized file name. * @return string */ public function getSanitizedName() { return trim(Nette\Utils\Strings::webalize($this->name, '.', FALSE), '.-'); } /** * Returns the MIME content type of an uploaded file. * @return string|NULL */ public function getContentType() { if ($this->isOk() && $this->type === NULL) { $this->type = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $this->tmpName); } return $this->type; } /** * Returns the size of an uploaded file. * @return int */ public function getSize() { return $this->size; } /** * Returns the path to an uploaded file. * @return string */ public function getTemporaryFile() { return $this->tmpName; } /** * Returns the path to an uploaded file. * @return string */ public function __toString() { return (string) $this->tmpName; } /** * Returns the error code. {@link http://php.net/manual/en/features.file-upload.errors.php} * @return int */ public function getError() { return $this->error; } /** * Is there any error? * @return bool */ public function isOk() { return $this->error === UPLOAD_ERR_OK; } /** * Move uploaded file to new location. * @param string * @return self */ public function move($dest) { @mkdir(dirname($dest), 0777, TRUE); // @ - dir may already exist @unlink($dest); // @ - file may not exists if (!call_user_func(is_uploaded_file($this->tmpName) ? 'move_uploaded_file' : 'rename', $this->tmpName, $dest)) { throw new Nette\InvalidStateException("Unable to move uploaded file '$this->tmpName' to '$dest'."); } chmod($dest, 0666); $this->tmpName = $dest; return $this; } /** * Is uploaded file GIF, PNG or JPEG? * @return bool */ public function isImage() { return in_array($this->getContentType(), array('image/gif', 'image/png', 'image/jpeg'), TRUE); } /** * Returns the image. * @return Nette\Utils\Image * @throws Nette\Utils\ImageException */ public function toImage() { return Nette\Utils\Image::fromFile($this->tmpName); } /** * Returns the dimensions of an uploaded image as array. * @return array|NULL */ public function getImageSize() { return $this->isOk() ? @getimagesize($this->tmpName) : NULL; // @ - files smaller than 12 bytes causes read error } /** * Get file contents. * @return string|NULL */ public function getContents() { // future implementation can try to work around safe_mode and open_basedir limitations return $this->isOk() ? file_get_contents($this->tmpName) : NULL; } }
Crotin
Name
Size
Permissions
Modified
User/Group
SessionSection.php
4731
0644
2015-09-30 18:28:53
Unknown/Unknown
Url.php
10152
0644
2015-09-30 18:28:53
Unknown/Unknown
Session.php
13365
0644
2015-09-30 18:28:54
Unknown/Unknown
UserStorage.php
4543
0644
2015-09-30 18:28:53
Unknown/Unknown
IRequest.php
2686
0644
2015-09-30 18:28:53
Unknown/Unknown
IResponse.php
3724
0644
2015-09-30 18:28:54
Unknown/Unknown
Context.php
2093
0644
2015-09-30 18:28:54
Unknown/Unknown
UrlScript.php
1435
0644
2015-09-30 18:28:54
Unknown/Unknown
FileUpload.php
3934
0644
2015-09-30 18:28:54
Unknown/Unknown
RequestFactory.php
6527
0644
2015-09-30 18:28:54
Unknown/Unknown
ISessionStorage.php
516
0644
2015-09-30 18:28:53
Unknown/Unknown
Request.php
6795
0644
2015-09-30 18:28:54
Unknown/Unknown
Helpers.php
1873
0644
2015-09-30 18:28:53
Unknown/Unknown
Response.php
7984
0644
2015-09-30 18:28:54
Unknown/Unknown
NGANU
Rename
Hapus
Chmod
Chown
Touch
Zip
Unzip
Download
Crotin