当前位置: 首页>>代码示例>>PHP>>正文


PHP Uploader::saveIn方法代码示例

本文整理汇总了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;
}
开发者ID:smithnikki,项目名称:sites,代码行数:13,代码来源:upload.php

示例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;
}
开发者ID:arvin-tcm,项目名称:CS526_Web,代码行数:16,代码来源:add.php

示例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;
开发者ID:Yves-T,项目名称:PHP3_BLOG,代码行数:21,代码来源:images.php


注:本文中的Uploader::saveIn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。