|
@@ -275,6 +275,23 @@ function getStoragePath($path) {
|
|
|
}
|
|
|
|
|
|
function getFileView($path) {
|
|
|
+
|
|
|
$complete_path = "https://report.jinjianghc.com/" . getStoragePath($path);
|
|
|
return "https://fileview.jinjianghc.com/onlinePreview?url=" . base64_encode($complete_path);
|
|
|
}
|
|
|
+
|
|
|
+function isImage($filename)
|
|
|
+{
|
|
|
+ $types = '.gif|.jpeg|.png|.bmp'; //定义检查的图片类型
|
|
|
+ if(file_exists($filename))
|
|
|
+ {
|
|
|
+ if ($info = getimagesize($filename)) return 0;
|
|
|
+
|
|
|
+ $ext = image_type_to_extension($info['2']);
|
|
|
+ return stripos($types,$ext);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+}
|