fix:법인도장 업로드를 base64 방식으로 변경 (PHP upload_max_filesize 제한 우회)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -54,11 +54,15 @@ public function getStamp(): JsonResponse
|
||||
public function uploadStamp(Request $request): JsonResponse
|
||||
{
|
||||
$request->validate([
|
||||
'stamp_image' => 'required|image|max:5120',
|
||||
'stamp_image_data' => 'required|string',
|
||||
]);
|
||||
|
||||
$tenantId = session('selected_tenant_id', 1);
|
||||
$file = $request->file('stamp_image');
|
||||
$imageData = base64_decode($request->input('stamp_image_data'));
|
||||
|
||||
if (!$imageData) {
|
||||
return response()->json(['success' => false, 'message' => '이미지 데이터가 올바르지 않습니다.'], 422);
|
||||
}
|
||||
|
||||
$path = "esign/{$tenantId}/stamps/company_stamp.png";
|
||||
|
||||
@@ -67,7 +71,7 @@ public function uploadStamp(Request $request): JsonResponse
|
||||
Storage::disk('local')->delete($path);
|
||||
}
|
||||
|
||||
Storage::disk('local')->put($path, file_get_contents($file->getRealPath()));
|
||||
Storage::disk('local')->put($path, $imageData);
|
||||
|
||||
TenantSetting::updateOrCreate(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user