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


PHP UploadHandler::get_response方法代码示例

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


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

示例1: upload

 public function upload($options = null)
 {
     if (!isset($options['print_response'])) {
         $options['print_response'] = false;
     }
     $upload = new \UploadHandler($options);
     return $upload->get_response();
 }
开发者ID:hashmode,项目名称:cakephp-jquery-file-upload,代码行数:8,代码来源:JqueryFileUploadComponent.php

示例2: json_encode

} else {
    if ($entity_name == "temp") {
        //redirect uploaded content back to client side after some processing
        // for example in term list import
        $options = array('upload_dir' => HEURIST_FILESTORE_DIR . 'scratch/', 'upload_url' => HEURIST_FILESTORE_URL . 'scratch/', 'max_file_size' => @$_REQUEST['max_file_size']);
    } else {
        $options = array('upload_dir' => HEURIST_FILESTORE_DIR . 'entity/' . $entity_name . '/', 'upload_url' => HEURIST_FILESTORE_URL . 'entity/' . $entity_name . '/', 'unique_filename' => false, 'newfilename' => @$_REQUEST['newfilename'], 'correct_image_extensions' => true, 'image_versions' => array('thumbnail' => array('max_width' => 120, 'max_height' => 120, 'scale_to_png' => true)));
    }
}
$options['print_response'] = false;
$upload_handler = new UploadHandler($options);
// from 3d party uploader
//@todo set print_response=false
//and send to client standard HEURIST response
$response = null;
$res = $upload_handler->get_response();
foreach ($res['files'] as $file) {
    if (@$file->error) {
        $response = $system->addError(HEURIST_UNKNOWN_ERROR, "File cannot be processed", $file->error);
        break;
    }
}
if ($response == null) {
    $response = array("status" => HEURIST_OK, "data" => $res);
}
header('Content-type: application/json');
print json_encode($response);
//
//  verification of uploaded file - @todo integrate with UploadHandler
//
function postmode_file_selection()
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:31,代码来源:fileUpload.php

示例3: json_encode

<?php

session_start();
$_SESSION['file_name'] = false;
require 'UploadHandler.php';
$upload_handler = new UploadHandler(array('accept_file_types' => '/\\.(gif|jpe?g|png)$/i', 'user_dirs' => true, 'print_response' => false, 'image_versions' => array('' => array('auto_orient' => true), 'thumbnail' => array('max_width' => 200, 'max_height' => 200))));
//get default
$responseFromUploader = $upload_handler->get_response();
$files = $responseFromUploader['files'];
$absPath = false;
foreach ($files as $file) {
    $_SESSION['file_name'] = $file->name;
}
header('Content-type: application/json');
echo json_encode($upload_handler->get_response());
开发者ID:pentatonicfunk,项目名称:boxed-image,代码行数:15,代码来源:upload.php


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