本文整理汇总了PHP中Uploader::saveIn方法的典型用法代码示例。如果您正苦于以下问题:PHP Uploader::saveIn方法的具体用法?PHP Uploader::saveIn怎么用?PHP Uploader::saveIn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Uploader
的用法示例。
在下文中一共展示了Uploader::saveIn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upload
function upload()
{
include_once "classes/Uploader.class.php";
$uploader = new Uploader("image-data");
$uploader->saveIn("img");
$fileUploaded = $uploader->save();
if ($fileUploaded) {
$out = "new file uploaded";
} else {
$out = "something went wrong";
}
return $out;
}
示例2: upload
function upload()
{
include_once 'models/Uploader.php';
$uploader = new Uploader('image_data');
$uploader->saveIn('img');
$fileUploaded = $uploader->save();
if ($fileUploaded) {
$out = 'new file uploaded';
} else {
$out = 'something went wrong';
}
$out .= "<pre>";
$out .= print_r($_FILES, true);
$out .= "</pre>";
return $out;
}
示例3: isset
<?php
include_once "models/Uploader.class.php";
$imageSubmitted = isset($_POST['new-image']);
if ($imageSubmitted) {
$uploader = new Uploader('image-data');
$uploader->saveIn("img");
try {
$uploader->save();
$uploadMessage = "file uploaded!";
} catch (Exception $exception) {
$uploadMessage = $exception->getMessage();
}
}
$deleteImage = isset($_GET['delete-image']);
if ($deleteImage) {
$whichImage = $_GET['delete-image'];
unlink($whichImage);
}
$imageManagerHTML = (include_once "views/admin/images_html.php");
return $imageManagerHTML;