本文整理汇总了PHP中Files::getFileName方法的典型用法代码示例。如果您正苦于以下问题:PHP Files::getFileName方法的具体用法?PHP Files::getFileName怎么用?PHP Files::getFileName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Files
的用法示例。
在下文中一共展示了Files::getFileName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: genImagen
private function genImagen()
{
$name = Files::getFileName($this->nombre);
if (file_exists(Server::getRoot() . '/podcast/caratulas/' . $name . '.jpg')) {
return $name . '.jpg';
} else {
return 'default.jpg';
}
}
示例2: Save
public function Save(Files $file)
{
$SQL = self::$INSERT;
$conn = self::$db->getConnection();
$stmt = $conn->prepare($SQL);
$stmt->bindValue(':filetype', $file->getFileType());
$stmt->bindValue(':filename', $file->getFileName());
$stmt->bindValue(':dataofupload', $file->getDateOfUpload());
$stmt->bindValue(':userseq', $file->getUserSeq());
$stmt->bindValue(':folderseq', $file->getFileSeq());
//if($SQL == self::$UPDATE){
// $stmt->bindValue(':folderseq',$folder->getSeq());
// }
$stmt->execute();
//I will be put code here for throw exception and show on the screen
$error = $stmt->errorInfo();
}
示例3: uploadFile
/**
* @author Frank Wichers Schreur <frank@superbuddy.nl>
*
* Uploads the file to Yuki
*
* @param Files $file
* @param Integer $ordner
*
* @return Response
*/
public function uploadFile($file, $ordner)
{
// Validate the category
$available_ordners = [0, 1, 2, 3, 4, 5, 6, 7, 8, 100, 101, 102];
if (!in_array($ordner, $available_ordners)) {
return false;
}
try {
$url = "https://api.yukiworks.nl/docs/Upload.aspx" . '?WebServiceAccessKey=' . config('yuki.access_key') . '&Administration=' . $this->administrationId . '&FileName=' . urlencode($file->getFileName() . "." . $file->getExtension());
$file_content = file_get_contents($file->getRealPath());
$type = File::mimeType($file->getRealPath());
$params = ['http' => ['method' => 'POST', 'header' => 'Content-Type: ' . $type . "\r\n" . 'Content-Length: ' . $file->getSize(), 'content' => $file_content]];
$ctx = stream_context_create($params);
$fp = fopen($url, 'rb', false, $ctx);
$response = @stream_get_contents($fp);
} catch (Exeption $e) {
return $e;
}
return $response;
}
示例4: Files
<?php
include 'src/php/files.php';
include 'src/php/monitor.php';
try {
if ($_FILES) {
$file = new Files("./files/", $_FILES);
$monitor = new Monitor($file->getFileName(), "files/");
}
} catch (Exception $e) {
echo 'Exception: ', $e->getMessage(), "\n";
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Station Monitor</title>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="src/css/default.css">
</head>
<body role="document">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Station Monitor</a>
示例5: foreach
foreach ($result as $imagen) {
if ($imagen[0] !== 0) {
echo '<li>' . $imagen[4] . ' | ' . 'error ' . $imagen[0] . ': ' . $imagen[1] . '</li><br/>';
}
}
?>
</ul>
<div>
<a href="index.html">Volver</a>
</div>
<div>
<h3>Imagenes de <?php
echo $datos[0];
?>
</h3>
<?php
foreach ($imagenes as $imagen) {
$usuImg = explode('-', $imagen);
if (Files::getFileName($imagen) === $datos[0] || $usuImg[0] === $datos[0]) {
echo "<a href='phpGetImagen.php?i={$imagen}' target='_blank'><img src='phpGetImagen.php?i={$imagen}' width='150'></a><br/>";
echo $imagen . '<br/>';
}
}
?>
</div>
</div>
<span class="texto_oculto">Fin de la página</span>
</div>
</body>
</html>
示例6: Session
<?php
require_once '../classes/Autoload.php';
$session = new Session();
if ($session->isLoggeg()) {
$cancion = new Cancion(Request::get('c'));
var_dump($cancion);
if ($cancion != null) {
$rutaCan = "../canciones/" . $cancion->getNombre();
$rutaImg = "../caratulas/" . $cancion->getImagen();
Files::delFile($rutaCan);
if (is_file($rutaImg) && Files::getFileName($rutaCan) === Files::getFileName($rutaImg)) {
Files::delFile($rutaImg);
}
}
}
Utils::redirect();