File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,19 @@ private function moveFile($upload_file, $cus_name)
4040 return $ filename ;
4141 }
4242
43+ public function fullpath ($ filename )
44+ {
45+ if (mb_substr ($ this ->basepath , -1 , 1 , 'utf8 ' ) != '/ ' ) {
46+ $ this ->basepath .= '/ ' ;
47+ }
48+
49+ if (preg_match ('/^\// ' , $ filename )) {
50+ return $ this ->basepath . mb_substr ($ filename , 1 , null , 'utf8 ' );
51+ }
52+
53+ return $ this ->basepath . $ filename ;
54+ }
55+
4356 public function response ($ filename )
4457 {
4558 try {
@@ -62,6 +75,8 @@ public function response($filename)
6275 return response (null , 304 )->setPublic ();
6376 } catch (FileNotFoundException $ e ) {
6477 abort (404 );
78+ } catch (\Illuminate \Contracts \Filesystem \FileNotFoundException $ e ) {
79+ abort (404 );
6580 }
6681 }
6782}
You can’t perform that action at this time.
0 commit comments