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


PHP Upload::getResult方法代码示例

本文整理汇总了PHP中Upload::getResult方法的典型用法代码示例。如果您正苦于以下问题:PHP Upload::getResult方法的具体用法?PHP Upload::getResult怎么用?PHP Upload::getResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Upload的用法示例。


在下文中一共展示了Upload::getResult方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: uploadImages

function uploadImages($images, $regId)
{
    $Upload = new Upload();
    $regImage = new NcRegImage();
    if (!empty($images)) {
        foreach ($images as $img) {
            if (!empty($img->FILE)) {
                $Title = Check::Name(substr($img->FILE->name, 0, strrpos($img->FILE->name, '.')));
                $FileName = $Title . strrchr($img->FILE->name, '.');
                $Upload->Image((array) $img->FILE);
                unlink($img->FILE->tmp_name);
                $regImage->setImage_name($FileName);
                $regImage->setImage_url($Upload->getResult());
                $regImage->setImage_date(date('Y-m-d H:i:s'));
                $regImage->setReg_id($regId);
                $regImage->Execute()->insert();
            }
        }
    }
}
开发者ID:adrianosilvareis,项目名称:intranet,代码行数:20,代码来源:registro.api.php

示例2: sendPhotoCam

 private function sendPhotoCam($flag)
 {
     if (!empty($this->Data['educando_photocam'])) {
         $this->Data['educando_photocam'] = base64_decode($this->Data['educando_photocam']);
         $image = new Upload('uploads/');
         if ($flag) {
             $this->checkCover();
         }
         $image->saveImageCam($this->Data['educando_photocam'], $this->Data['educando_nome'], 'educandos');
         if ($image->getError()) {
             $this->Error = $image->getError();
             $this->Result = false;
         } else {
             $this->Data['educando_foto'] = $image->getResult();
             $this->Result = true;
         }
     }
     unset($this->Data['educando_photocam']);
 }
开发者ID:claytongf,项目名称:patr,代码行数:19,代码来源:AdminEducando.class.php

示例3: Upload

<html lang="pt-br">
    <head>
        <meta charset="UTF-8">
        <title>Helper de gestão de conteúdo</title>
        <link rel="stylesheet" href="css/reset.css" />
    </head>
    <body>
        <?php 
require './_app/Config.inc.php';
$form = filter_input_array(INPUT_POST, FILTER_DEFAULT);
if ($form && $form['SendImage']) {
    $upload = new Upload('uploads/');
    $imagem = $_FILES['image'];
    //            var_dump($imagem);
    $upload->Image($imagem);
    if (!$upload->getResult()) {
        WSErro("Erro ao enviar imágem!<br><small>{$upload->getError()}</small>", WS_ERROR);
    } else {
        WSErro("Imágem enviada com sucesso!<br><small>{$upload->getResult()}</small>", WS_ACCEPT);
    }
    echo '<hr>';
    var_dump($upload);
}
?>

        <form name="fileform" action="" method="post" enctype="multipart/form-data">
            <label>
                <input type="file" name="image"/>
            </label>
            <input type="submit" name="SendImage" value="Enviar arquivo!"/>
        </form>
开发者ID:BrunoDuarte,项目名称:WS_PHP_ADMIN,代码行数:31,代码来源:06-helper-de-gestao-de-uploads.php

示例4: sendCapa

 private function sendCapa()
 {
     if (!empty($this->Data['empresa_capa']['tmp_name'])) {
         list($w, $h) = getimagesize($this->Data['empresa_capa']['tmp_name']);
         if ($w != '578' || $h != '288') {
             $_SESSION['errCapa'] = ['Capa Inválida: A Capa da empresa deve ter exatamente 578x288px do tipo .JPG, .PNG ou .GIF!', WS_INFOR];
             $this->Result = false;
             $this->Data['empresa_capa'] = null;
         } else {
             $this->checkCover();
             $Upload = new Upload();
             $Upload->Image($this->Data['empresa_capa'], $this->Data['empresa_name'], 578, 'empresas');
             if ($Upload->getError()) {
                 $this->Error = $Upload->getError();
                 $this->Result = false;
             } else {
                 $this->Data['empresa_capa'] = $Upload->getResult();
                 $this->Result = true;
             }
         }
     }
 }
开发者ID:adrianosilvareis,项目名称:FrameWork_Front,代码行数:22,代码来源:AdminEmpresa.class.php

示例5: sendCapa

 private function sendCapa()
 {
     if (!empty($this->Data['user_capa']['tmp_name'])) {
         list($w, $h) = getimagesize($this->Data['user_capa']['tmp_name']);
         $w = 44;
         //largura da imagem do avatar
         $this->checkCover();
         $Upload = new Upload();
         $Upload->Image($this->Data['user_capa'], $this->Data['user_name'], $w, 'users');
         if ($Upload->getError()) {
             $this->Error = $Upload->getError();
             $this->Result = false;
         } else {
             $this->Data['user_capa'] = $Upload->getResult();
             $this->Result = true;
         }
     }
 }
开发者ID:claytongf,项目名称:patr,代码行数:18,代码来源:AdminUser.class.php

示例6: Read

    $busca = new Read();
    $busca->ExeRead("extensao", "WHERE id = :id", "id={$i}");
}
if (isset($_POST['titulo'])) {
    $file = $_FILES['extensao'];
    if ($file['name']) {
        //$pdf = substr($busca->getResult()[0]['arquivo'], 0, strrpos($busca->getResult()[0]['arquivo'], '.'));
        //unlink("uploads/{$pdf}");
        $upload = new Upload('uploads/');
        $upload->File($file);
        //se deu errado
        if ($upload->getError()) {
            $texto = $upload->getError();
        } else {
            unlink("uploads/{$busca->getResult()[0]['arquivo']}");
            $dados = ['titulo' => $_POST['titulo'], 'resumo' => $_POST['resumo'], 'ano' => $_POST['ano'], 'autores' => $_POST['autores'], 'coordenador' => $_POST['coordenador'], 'unidadeExecutora' => $_POST['unidadeExecutora'], 'area' => $_POST['area'], 'dataInicio' => $_POST['dataInicio'], 'dataTermino' => $_POST['dataTermino'], 'arquivo' => $upload->getResult()];
            $update = new Update();
            $update->ExeUpdate('extensao', $dados, "WHERE id = :id", "id={$i}");
            if ($update->getResult()) {
                $resultado = true;
                //echo "{$update->getRowCount()} dados atualizados com sucesso! <hr>";
                $busca->ExeRead("extensao", "WHERE id = :id", "id={$i}");
            }
        }
    } else {
        $dados = ['titulo' => $_POST['titulo'], 'resumo' => $_POST['resumo'], 'ano' => $_POST['ano'], 'autores' => $_POST['autores'], 'coordenador' => $_POST['coordenador'], 'unidadeExecutora' => $_POST['unidadeExecutora'], 'area' => $_POST['area'], 'dataInicio' => $_POST['dataInicio'], 'dataTermino' => $_POST['dataTermino']];
        $update = new Update();
        $update->ExeUpdate('extensao', $dados, "WHERE id = :id", "id={$i}");
        if ($update->getResult()) {
            $resultado = true;
            //echo "{$update->getRowCount()} dados atualizados com sucesso! <hr>";
开发者ID:brenolessa,项目名称:projeto-RI-Br,代码行数:31,代码来源:editarExtensao.php

示例7: Error

<?php

if (!strpos($file['name'], '.csv')) {
    Error(501);
} else {
    $Upload = new Upload();
    $Upload->File($file);
    $filename = DOCUMENT_ROOT . NAME . "/uploads/" . $Upload->getResult();
    if (file_exists($filename)) {
        $FileRead = fopen($filename, "r");
        $Read = new Controle('sft_particular');
        $Read->truncate();
        $Erros = [];
        while (!feof($FileRead)) {
            $file = fgets($FileRead);
            $Linha = !empty($file) ? explode(";", utf8_encode($file)) : null;
            if (is_array($Linha) && count($Linha) == 12) {
                $Erro = null;
                $Objeto = array();
                $Objeto['part_os'] = $Linha[0];
                $Objeto['part_date'] = Check::Data($Linha[1]);
                $Objeto['part_nm_paciente'] = $Linha[4];
                $Objeto['part_vl_liquido'] = Check::toFloat($Linha[9]);
                $Objeto['part_vl_pago'] = Check::toFloat($Linha[10]);
                $Objeto['part_vl_debito'] = Check::toFloat($Linha[11]);
                $Linha[2] = $Linha[2] == '0' ? "418 - Sistema" : $Linha[2];
                $findUser = explode(" - ", $Linha[2])[1];
                $atendente = FindUser($findUser);
                $findCode = explode('-', $Linha[0])[0];
                $unidade = FindCod($findCode);
                if (!$atendente) {
开发者ID:adrianosilvareis,项目名称:intranet,代码行数:31,代码来源:uploadparticular.api.php

示例8: UpdateImage

 private function UpdateImage()
 {
     if (is_array($this->Data['post_cover'])) {
         $WsPosts = new WsPosts();
         $WsPosts->setPost_id($this->Post);
         $WsPosts->Execute()->find();
         $this->deletaImagem('../uploads/' . $WsPosts->Execute()->getResult()->post_cover);
         $upload = new Upload();
         $upload->Image($this->Data['post_cover'], $this->Data['post_name']);
     }
     if (isset($upload) && $upload->getResult()) {
         $this->Data['post_cover'] = $upload->getResult();
         $this->Update();
     } else {
         unset($this->Data['post_cover']);
         if (!empty($upload) && $upload->getError()) {
             WSErro("<b>ERRO AO ENVIAR CAPA: </b>" . $upload->getError(), E_USER_WARNING);
         }
         $this->Update();
     }
 }
开发者ID:adrianosilvareis,项目名称:OutlineTecnolog,代码行数:21,代码来源:AdminPost.class.php

示例9: Upload

}
if (isset($_POST['titulo'])) {
    //$form= filter_input_array(INPUT_POST, FILTER_DEFAULT);
    //if($form && $form['submit']){
    $file = $_FILES['publicacao'];
    if ($file['name']) {
        //$pdf = substr($busca->getResult()[0]['arquivo'], 0, strrpos($busca->getResult()[0]['arquivo'], '.'));
        //unlink("uploads/{$pdf}");
        $upload = new Upload('uploads/');
        $upload->File($file);
        //se deu errado
        if ($upload->getError()) {
            $texto = $upload->getError();
        } else {
            unlink("uploads/{$busca->getResult()[0]['arquivo']}");
            $dados = ['titulo' => $_POST['titulo'], 'resumo' => $_POST['resumo'], 'ano' => $_POST['ano'], 'autores' => $_POST['autores'], 'evento' => $_POST['evento'], 'area' => $_POST['area'], 'arquivo' => $upload->getResult()];
            $update = new Update();
            $update->ExeUpdate('publicacao', $dados, "WHERE id = :id", "id={$i}");
            if ($update->getResult()) {
                $resultado = true;
                //echo "{$update->getRowCount()} dados atualizados com sucesso! <hr>";
                //header("Location:editarPesquisa.php?id=$i");
                $busca->ExeRead("publicacao", "WHERE id = :id", "id={$i}");
            }
        }
    } else {
        $dados = ['titulo' => $_POST['titulo'], 'resumo' => $_POST['resumo'], 'ano' => $_POST['ano'], 'autores' => $_POST['autores'], 'evento' => $_POST['evento'], 'area' => $_POST['area']];
        $update = new Update();
        $update->ExeUpdate('publicacao', $dados, "WHERE id = :id", "id={$i}");
        if ($update->getResult()) {
            $resultado = true;
开发者ID:brenolessa,项目名称:projeto-RI-Br,代码行数:31,代码来源:editarPublicacao.php

示例10: Upload

} else {
    $userLogin = $_SESSION['userlogin'];
}
$resultado = false;
$texto = null;
$form = filter_input_array(INPUT_POST, FILTER_DEFAULT);
if ($form && $form['submit']) {
    $file = $_FILES['pesquisa'];
    if ($file['name']) {
        $upload = new Upload('uploads/');
        $upload->File($file);
        if ($upload->getError()) {
            $texto = $upload->getError();
        }
        $dados = ['titulo' => $_POST['titulo'], 'resumo' => $_POST['resumo'], 'ano' => $_POST['ano'], 'autores' => $_POST['autores'], 'orientador' => $_POST['orientador'], 'outorga' => $_POST['outorga'], 'modalidade' => $_POST['modalidade'], 'financiamento' => $_POST['financiamento'], 'area' => $_POST['area']];
        if ($upload->getResult()) {
            $cadastra = new Create();
            $cadastra->ExeCreate('pesquisa', $dados);
            if ($cadastra->getResult()) {
                $resultado = true;
            }
        }
    }
}
?>
<!DOCTYPE html>
<html class="ls-theme-green">
  <head>
    <title>Repositório Institucional - IFBA - VCA</title>

    <?php 
开发者ID:brenolessa,项目名称:projeto-RI-Br,代码行数:31,代码来源:cadastroPesquisa.php

示例11: WSErro

    $data = array_map('trim', $empDataGet);
    $data['empresa_capa'] = $_FILES['empresa_capa'];
    if (in_array('', $data) || $data['empresa_capa']['error'] != 0) {
        WSErro("Oppsss: Para cadastrar sua empresa, preencha todos os campos. <b>Tudo é obrigatório aqui!</b> :)", WS_ERROR);
    } else {
        //CADASTRAR EMPRESA... NOME DA CAPA COM EMPRESA_NAME PÓS CAD
        $data['empresa_name'] = Check::Name($data['empresa_title']);
        $data['empresa_date'] = date('Y-m-d H:i:s');
        $empresa = new Controle('app_empresas');
        $empresa->Query("#empresa_title#", "empresa_title={$data['empresa_title']}");
        if ($empresa->getResult()) {
            $data['empresa_name'] = $data['empresa_name'] . '-' . $empresa->getRowCount();
        }
        $sendCapa = new Upload('uploads/');
        $sendCapa->Image($data['empresa_capa'], $data['empresa_name'], 578, 'empresas');
        $data['empresa_capa'] = $sendCapa->getResult();
        $cadastra = $empresa->insert($data);
        if ($cadastra) {
            header('Location: ' . HOME . '/cadastra-empresa/create');
        }
    }
}
?>

        <form name="PostForm" action="" method="post" enctype="multipart/form-data">

            <label class="label">
                <span class="field">Logo da empresa: <sup>Exatamente 578x288px (JPG ou PNG)</sup></span>
                <input type="file" name="empresa_capa" />
            </label>
开发者ID:adrianosilvareis,项目名称:OutlineTecnolog,代码行数:30,代码来源:cadastra-empresa.php

示例12: Upload

     //retorno não implementado
     echo json_encode($request);
     break;
 case "POST":
     //Adiciona arquivo a pasta temporaria
     if (!empty($_FILES['files'])) {
         $gbFiles = Check::ListFiles($_FILES['files']);
         $Upload = new Upload();
         $RESP = array();
         $i = 0;
         foreach ($gbFiles as $File) {
             $Upload->File($File, null, 'temp', 50);
             if ($Upload->getError() && stripos($Upload->getError(), 'image')) {
                 $Upload->Image($File, null, null, 'temp');
             }
             $File['tmp_name'] = BASEDIR . '/uploads/' . $Upload->getResult();
             $RESP[$i]['RESULT'] = HOME . '/uploads/' . $Upload->getResult();
             $RESP[$i]['TYNY'] = HOME . "/tim.php?src=" . $RESP[$i]['RESULT'] . "&w=202&h=105";
             $RESP[$i]['URL'] = $Upload->getResult();
             $RESP[$i]['ERROS'] = $Upload->getError();
             $RESP[$i]['FILE'] = $File;
             $i++;
         }
         if ($Upload->getResult()) {
             echo json_encode($RESP);
         } else {
             echo $Upload->getError();
         }
     }
     break;
 case "DELETE":
开发者ID:adrianosilvareis,项目名称:intranet,代码行数:31,代码来源:upload.api.php

示例13: Upload

<?php 
require 'app/Config.inc.php';
$resultado = false;
$texto = null;
$form = filter_input_array(INPUT_POST, FILTER_DEFAULT);
if ($form && $form['submit']) {
    $file = $_FILES['publicacao'];
    if ($file['name']) {
        $upload = new Upload('uploads/');
        $upload->File($file);
        if ($upload->getError()) {
            $texto = $upload->getError();
        }
        $dados = ['titulo' => $_POST['titulo'], 'resumo' => $_POST['resumo'], 'ano' => $_POST['ano'], 'autores' => $_POST['autores'], 'evento' => $_POST['evento'], 'arquivo' => $upload->getResult(), 'aprovado' => 'N', 'area' => $_POST['area']];
        if ($upload->getResult()) {
            $cadastra = new Create();
            $cadastra->ExeCreate('publicacao', $dados);
            if ($cadastra->getResult()) {
                $resultado = true;
            }
        }
    }
}
?>
<!DOCTYPE html>
<html lang="pt-br">
  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
开发者ID:brenolessa,项目名称:projeto-RI-Br,代码行数:30,代码来源:submeter.php

示例14: header

<?php

if (!Check::UserLogin(2)) {
    header("Location: " . HOME . "/plugin/aniversarios/");
}
$uploads = filter_input_array(INPUT_POST, FILTER_DEFAULT);
if (!empty($uploads) && $uploads['sendPostForm']) {
    $uploads['post_files'] = $_FILES['Arquivo']['tmp_name'] ? $_FILES['Arquivo'] : null;
    unset($uploads['sendPostForm']);
    $Upload = new Upload('uploads/');
    $Upload->File($uploads['post_files']);
    header("Location: " . HOME . "/plugin/aniversarios/save&file=" . $Upload->getResult());
}
?>

<div class="section" style="height: 350px;">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <h1 class="text-center">Uploads</h1>
            </div>
        </div>
        <div class="row">
            <div class="col-md-offset-3 col-md-6">
                <form name="PostForm" action="" method="post" enctype="multipart/form-data">
                    <div class="form-group">
                        <div class="input-group">
                            <input type="file" class="form-control" placeholder="Selecione um arquivo" name="Arquivo">
                            <span class="input-group-btn">
                                <input class="btn btn-success" type="submit" value="Go" name="sendPostForm"/>
                            </span>
开发者ID:adrianosilvareis,项目名称:intranet,代码行数:31,代码来源:upload.php


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