本文整理汇总了PHP中Uploader::setDstPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Uploader::setDstPath方法的具体用法?PHP Uploader::setDstPath怎么用?PHP Uploader::setDstPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Uploader
的用法示例。
在下文中一共展示了Uploader::setDstPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getimagesize
}
}
if (isset($_FILES['picture'])) {
FB::log($_POST, 'POST');
FB::log($_FILES, 'FILES');
$imagesize = getimagesize($_FILES['picture']['tmp_name']);
FB::log($imagesize, 'label');
if (!in_array($_FILES['picture']['type'], array('image/jpeg', 'image/jpg', 'image/pjpeg'))) {
$error = 'Votre fichier doit être au format jpeg.';
} elseif ($imagesize[0] / $imagesize[1] != 740 / 340) {
$error = 'Les dimensions de votre image doivent être de 740x340 ou bien d\'un ratio équivalent.';
} else {
require 'classes/uploader.class.php';
try {
$upload = new Uploader($_FILES['picture']);
$upload->setDstPath(getFtpAircraftsRoot() . '/' . $_POST['rep'] . '/');
$upload->upload();
$confirm = "L'image " . $_FILES['picture']['name'] . " a été ajoutée";
} catch (UploaderException $e) {
$error = $e->getMessage();
}
}
}
// Tous les aircrats
$aircrafts = $db->getAllProducts();
foreach ($aircrafts as $aircraft) {
$aircraft->images = array();
if (is_dir(getFtpAircraftsRoot() . '/' . $aircraft->rep . '/')) {
$aircraft->images = readdir_recursive(getFtpAircraftsRoot() . '/' . $aircraft->rep . '/', array('jpg'));
}
}
示例2: getimagesize
FB::log($_POST, 'POST');
FB::log($_FILES, 'FILES');
for ($i = 0; $i < count($_FILES['brochures']['name']); $i++) {
$imagesize = getimagesize($_FILES['brochures']['tmp_name'][$i]);
if (!in_array($_FILES['brochures']['type'][$i], array('application/pdf', 'application/x-pdf', 'application/vnd.pdf', 'text/pdf'))) {
$error = 'Votre fichier doit être au format pdf, mime fourni : ' . $_FILES['brochures']['type'][$i];
}
}
if (!isset($error)) {
$confirm = array();
require 'classes/uploader.class.php';
try {
for ($i = 0; $i < count($_FILES['brochures']['name']); $i++) {
$tmpfile = array('name' => $_FILES['brochures']['name'][$i], 'type' => $_FILES['brochures']['type'][$i], 'tmp_name' => $_FILES['brochures']['tmp_name'][$i], 'error' => $_FILES['brochures']['error'][$i], 'size' => $_FILES['brochures']['size'][$i]);
$upload = new Uploader($tmpfile);
$upload->setDstPath(getFtpRoot() . '/upload/');
$upload->upload();
$confirm[] = "Le document " . $_FILES['brochures']['name'][$i] . " a été uploadé.";
}
} catch (UploaderException $e) {
$error = $e->getMessage();
}
}
}
// Ajouter un accès à un document
if ($httpQuery->has('indexForm', 'active')) {
$user_key = keygen();
$id_avion = false;
$submitName = 'activate_access';
$submitValue = 'Activer';
$name = '';