Skip to content

Commit 4fc18d0

Browse files
committed
Controllers: Convert: Fixup python init
Signed-off-by: Dicky Herlambang (花) <[email protected]>
1 parent 280e504 commit 4fc18d0

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

app/Http/Controllers/proc/convertController.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public function convert(Request $request) {
129129
$pdfNameWithExtension = pathinfo($currentFileName, PATHINFO_EXTENSION);
130130
if ($convertType == 'xlsx') {
131131
$asposeAPI = new Process([
132-
'python',
132+
'python3',
133133
public_path().'/ext-python/asposeAPI.py',
134134
env('ASPOSE_CLOUD_CLIENT_ID'),
135135
env('ASPOSE_CLOUD_TOKEN'),
@@ -326,9 +326,9 @@ public function convert(Request $request) {
326326
->where('processId', '=', $Nuuid)
327327
->update([
328328
'errReason' => 'Converted file not found on the server !',
329-
'errApiReason' => $asposeAPI->getOutput(),
329+
'errApiReason' => $asposeAPI->getErrorOutput(),
330330
]);
331-
NotificationHelper::Instance()->sendErrNotify($currentFileName, $newFileSize, $Nuuid, 'FAIL', 'Converted file not found on the server !', $asposeAPI->getOutput());
331+
NotificationHelper::Instance()->sendErrNotify($currentFileName, $newFileSize, $Nuuid, 'FAIL', 'Converted file not found on the server !', $asposeAPI->getErrorOutput());
332332
return response()->json([
333333
'status' => 400,
334334
'message' => 'PDF Conversion failed !',
@@ -428,9 +428,9 @@ public function convert(Request $request) {
428428
->where('processId', '=', $Nuuid)
429429
->update([
430430
'errReason' => 'Converted file not found on the server !',
431-
'errApiReason' => $asposeAPI->getOutput(),
431+
'errApiReason' => $asposeAPI->getErrorOutput(),
432432
]);
433-
NotificationHelper::Instance()->sendErrNotify($currentFileName, $newFileSize, $Nuuid, 'FAIL', 'Converted file not found on the server !', $asposeAPI->getOutput());
433+
NotificationHelper::Instance()->sendErrNotify($currentFileName, $newFileSize, $Nuuid, 'FAIL', 'Converted file not found on the server !', $asposeAPI->getErrorOutput());
434434
return response()->json([
435435
'status' => 400,
436436
'message' => 'PDF Conversion failed !',
@@ -458,7 +458,7 @@ public function convert(Request $request) {
458458
}
459459
} else if ($convertType == 'pptx') {
460460
$asposeAPI = new Process([
461-
'python',
461+
'python3',
462462
public_path().'/ext-python/asposeAPI.py',
463463
env('ASPOSE_CLOUD_CLIENT_ID'),
464464
env('ASPOSE_CLOUD_TOKEN'),
@@ -655,13 +655,13 @@ public function convert(Request $request) {
655655
->where('processId', '=', $Nuuid)
656656
->update([
657657
'errReason' => 'Converted file not found on the server !',
658-
'errApiReason' => $asposeAPI->getOutput(),
658+
'errApiReason' => $asposeAPI->getErrorOutput(),
659659
]);
660-
NotificationHelper::Instance()->sendErrNotify($currentFileName, $newFileSize, $Nuuid, 'FAIL', 'Converted file not found on the server !', $asposeAPI->getOutput());
660+
NotificationHelper::Instance()->sendErrNotify($currentFileName, $newFileSize, $Nuuid, 'FAIL', 'Converted file not found on the server !', $asposeAPI->getErrorOutput());
661661
return response()->json([
662662
'status' => 400,
663663
'message' => 'PDF Conversion failed !',
664-
'error' => $asposeAPI->getOutput(),
664+
'error' => $asposeAPI->getErrorOutput(),
665665
'processId' => $Nuuid
666666
], 400);
667667
} catch (QueryException $ex) {
@@ -757,9 +757,9 @@ public function convert(Request $request) {
757757
->where('processId', '=', $Nuuid)
758758
->update([
759759
'errReason' => 'Converted file not found on the server !',
760-
'errApiReason' => $asposeAPI->getOutput(),
760+
'errApiReason' => $asposeAPI->getErrorOutput(),
761761
]);
762-
NotificationHelper::Instance()->sendErrNotify($currentFileName, $newFileSize, $Nuuid, 'FAIL', 'Converted file not found on the server !', $asposeAPI->getOutput());
762+
NotificationHelper::Instance()->sendErrNotify($currentFileName, $newFileSize, $Nuuid, 'FAIL', 'Converted file not found on the server !', $asposeAPI->getErrorOutput());
763763
return response()->json([
764764
'status' => 400,
765765
'message' => 'PDF Conversion failed !',

0 commit comments

Comments
 (0)