本文整理汇总了PHP中UploadFile::get_file_contents方法的典型用法代码示例。如果您正苦于以下问题:PHP UploadFile::get_file_contents方法的具体用法?PHP UploadFile::get_file_contents怎么用?PHP UploadFile::get_file_contents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UploadFile
的用法示例。
在下文中一共展示了UploadFile::get_file_contents方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uploadPublicFile
/**
* Method that extracts contents of a file and upload
* @param string $fileName
* @param boolean $getFileContents
* @return type
* @throws Exception
* @codeCoverageIgnore
*/
public static function uploadPublicFile($fileName, $getFileContents = true)
{
try {
$sugarUploader = new UploadFile($fileName);
if ($getFileContents) {
return $sugarUploader->get_file_contents();
} else {
$sugarUploader->confirm_upload();
$sugarUploader->final_move($fileName . '_' . create_guid());
return array();
}
} catch (Exception $oException) {
throw $oException;
}
}
示例2: getLogFile
/**
* @codeCoverageIgnore
*/
public function getLogFile($file)
{
//$this->bpmLog('INFO', " getting log from " . $file);
//return file_get_contents($file);
require_once 'include/upload_file.php';
$_file = new UploadFile();
//get the file location
$_file->temp_file_location = $file;
//alternatively you can do the following if you know the upload file id
//$file->temp_file_location = UploadFile::get_upload_path($file_id);
return $_file->get_file_contents();
}
示例3: getDataFile
/**
* Function to get a data for File uploaded
* @param $file
* @return mixed
*/
public function getDataFile($file)
{
//return file_get_contents($file);
require_once 'include/upload_file.php';
$_file = new UploadFile();
//get the file location
$_file->temp_file_location = $file;
$_data = $_file->get_file_contents();
return $_data;
}