# oss **Repository Path**: dafa168/oss ## Basic Information - **Project Name**: oss - **Description**: 单PHP文件-文件管理系统 - **Primary Language**: PHP - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2022-01-25 - **Last Updated**: 2024-07-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 单文件 - 文件管理器 index.php 为文件管理 frans.php 为文件上传 好东西: https://github.com/zbezj/HEU_KMS_Activator/releases ### 具体应用上传代码: ```php getRealPath()); $file = storage_path('logs' . DIRECTORY_SEPARATOR . time() . random_int(1000, 9999) . '.' . $fileObj->getClientOriginalExtension()); $ret = file_put_contents($file, $fileData); if ($ret) { try { $upload_url = config('upload.url'); $params = [ 'file' => new \CurlFile(realpath($file)), 'type' => $file_type, 'sign' => 'key', ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $upload_url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $params); $res = curl_exec($ch); curl_close($ch); unlink($file); info(__METHOD__ . ': ' . $res); return json_decode($res, true); } catch (\Exception $e) { report($e); return ['code' => 0, 'msg' => '异常:' . $e->getMessage()]; } } return ['code' => 0, 'msg' => '写入文件失败']; } } ```