本文整理汇总了PHP中UploadHandler::get_download_url方法的典型用法代码示例。如果您正苦于以下问题:PHP UploadHandler::get_download_url方法的具体用法?PHP UploadHandler::get_download_url怎么用?PHP UploadHandler::get_download_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UploadHandler
的用法示例。
在下文中一共展示了UploadHandler::get_download_url方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle_file_upload
protected function handle_file_upload($uploaded_file, $name, $size, $type, $error, $index = null, $content_range = null)
{
//processo para substituir o nome do arquivo
if (app_field_get_config("midia-ck-nome-banner")) {
$newname = md5(uniqid(rand(), true));
$name = explode(".", $name);
$ext = array_pop($name);
$name = trim($newname . '.' . $ext);
}
$file = parent::handle_file_upload($uploaded_file, $name, $size, $type, $error, $index, $content_range);
$url = parent::get_download_url($file->name);
$url = $url;
if (empty($file->error)) {
$ordem = getOrdem();
$sql = 'INSERT INTO `' . $this->options['db_table'] . '` ( `file_name`, `imagem_url`, `ordem`, `publicar`) VALUES (?, ?, ?, \'falso\')';
$query = $this->db->prepare($sql);
$query->bind_param('ssi', $file->name, $url, $ordem);
$query->execute();
//fim
}
return $file;
}