Skip to content

Commit

Permalink
Merge pull request #9130 from Maikuolan/patch-1
Browse files Browse the repository at this point in the history
Update upload.php
  • Loading branch information
DanielnetoDotCom authored Jun 13, 2024
2 parents 05f1858 + 3634dbb commit 7d754df
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugin/MobileManager/upload.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// if you want to usea third party app to submit video files, please check this https://github.com/WWBN/Upload-Sample
// If you want to use a third-party app to submit video files, please check https://github.com/WWBN/Upload-Sample

header('Access-Control-Allow-Headers: Content-Type');
header('Content-Type: application/json');
require_once dirname(__FILE__) . '/../../videos/configuration.php';
Expand Down Expand Up @@ -41,7 +41,7 @@
$prefix = 'i';
$extension = $image;
} else {
//chack if is an audio
// Check whether it's an audio file
$type = "video";
$prefix = 'v';
if (strcasecmp($extension, 'mp3') == 0 || strcasecmp($extension, 'wav') == 0) {
Expand All @@ -53,7 +53,7 @@
require_once $global['systemRootPath'] . 'objects/video.php';
$duration = Video::getDurationFromFile($_FILES['upl']['tmp_name']);

// check if can upload video (about time limit storage)
// Check whether video can be uploaded (about time limit storage)
if (!empty($global['videoStorageLimitMinutes'])) {
$maxDuration = $global['videoStorageLimitMinutes'] * 60;
$currentStorageUsage = getSecondsTotalVideosLength();
Expand Down Expand Up @@ -125,15 +125,15 @@
$object->msg = "We sent your video to the encoder";
}
$object->posterSent = false;

if(!empty($object->videos_id) && !empty($_REQUEST['base64PNG'])){
$filePng = "{$paths['path']}{$paths['filename']}.png";
$fileJpg = "{$paths['path']}{$paths['filename']}.jpg";
$object->posterSent = saveBase64DataToPNGImage($_REQUEST['base64PNG'], $filePng);
convertImage($filePng, $fileJpg, 90);
Video::clearImageCache($paths['filename']);
}

_error_log("MOBILE SUCCESS UPLOAD: ". json_encode($object));
die(json_encode($object));
} else {
Expand Down

0 comments on commit 7d754df

Please sign in to comment.