Update storage.php

This commit is contained in:
Namhyeon Go 2018-05-07 23:10:29 +09:00 committed by GitHub
parent 8936b2f3ce
commit 3ca127c141
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,16 +87,16 @@ if(!function_exists("move_uploaded_file_to_storage")) {
if(!function_exists("read_storage_file")) {
function read_storage_file($filename, $options=array()) {
$fcontents = "";
$storage_type = get_value_in_array("storage_type", $options, "data");
$upload_base_dir = get_storage_path($storage_type);
$upload_base_url = get_storage_url($storage_type);
$fcontents = "";
if($fhandle = fopen($filename, "r")) {
$fcontents = fread($fhandle, filesize($filename));
fclose($fhandle);
}
fclose($fhandle);
if(!array_key_empty("encode_base64", $options)) {
$fcontents = base64_encode($file_contents);