File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -973,6 +973,20 @@ public function get_thumbnails_url($path = '/')
973
973
return $ thumb_url ;
974
974
}
975
975
976
+ public function smallfileupload ($ path , $ tmpfile ) {
977
+ if (!$ _SERVER ['admin ' ]) {
978
+ $ tmp1 = splitlast ($ tmpfile ['name ' ], '. ' );
979
+ if ($ tmp1 [0 ]=='' ||$ tmp1 [1 ]=='' ) $ filename = md5_file ($ tmpfile ['tmp_name ' ]);
980
+ else $ filename = md5_file ($ tmpfile ['tmp_name ' ]) . '. ' . $ tmp1 [1 ];
981
+ } else {
982
+ $ filename = $ tmpfile ['name ' ];
983
+ }
984
+ $ content = file_get_contents ($ tmpfile ['tmp_name ' ]);
985
+ $ result = $ this ->MSAPI ('PUT ' , path_format ($ _SERVER ['list_path ' ] . '/ ' . $ path . '/ ' . $ filename ), $ content );
986
+ $ res = $ this ->files_format (json_decode ($ result ['body ' ], true ));
987
+ if (isset ($ res ['url ' ])) $ res ['url ' ] = $ _SERVER ['host ' ] . path_format ($ _SERVER ['base_disk_path ' ] . '/ ' . $ path . '/ ' . $ filename );
988
+ return output (json_encode ($ res , JSON_UNESCAPED_SLASHES ), $ result ['stat ' ]);
989
+ }
976
990
public function bigfileupload ($ path )
977
991
{
978
992
if ($ _POST ['upbigfilename ' ]=='' ) return output ('error: no file name ' , 400 );
You can’t perform that action at this time.
0 commit comments