本文整理匯總了PHP中UploadFile::getClientOriginalExtension方法的典型用法代碼示例。如果您正苦於以下問題:PHP UploadFile::getClientOriginalExtension方法的具體用法?PHP UploadFile::getClientOriginalExtension怎麽用?PHP UploadFile::getClientOriginalExtension使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UploadFile
的用法示例。
在下文中一共展示了UploadFile::getClientOriginalExtension方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: makeFileName
/**
* Make a file name based on the uploaded file.
*
* @return string
*/
protected function makeFileName()
{
$name = sha1(time() . $this->file->getClientOriginalName());
$extension = $this->file->getClientOriginalExtension();
return "{$name}.{$extension}";
}
示例2: __storeImagePost
/**
* Store image of post
* @param UploadFile $imagesFile
* @return string [new name image]
*/
private function __storeImagePost($imagesFile)
{
$nameImage = $imagesFile->getClientOriginalName();
$extensionImage = $imagesFile->getClientOriginalExtension();
$newNameImage = sha1($nameImage) . time() . "." . $extensionImage;
$desPath = public_path() . config('model.posts.path_folder_photo_post');
$imagesFile->move($desPath, $newNameImage);
return $newNameImage;
}