public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     $filename = $this->getPM('filename');
     // strip the filename from invalid characters
     $token = $this->getKsUniqueString();
     // should upload the file with the token as the prefix
     $res = myUploadUtils::uploadFileByToken($_FILES['Filedata'], $token, $filename, null, true);
     $this->addMsg("result_ok", $res);
 }
Esempio n. 2
0
 /**
  * 
  * @action upload
  * @param file $fileData The file data
  * @return string Upload token id
  */
 function uploadAction($fileData)
 {
     $ksUnique = md5($this->getKs()->toSecureString());
     $uniqueId = md5($fileData["name"]);
     $ext = pathinfo($fileData["name"], PATHINFO_EXTENSION);
     $token = $ksUnique . "_" . $uniqueId . "." . $ext;
     $res = myUploadUtils::uploadFileByToken($fileData, $token, "", null, true);
     return $res["token"];
 }
Esempio n. 3
0
 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     if (!isset($_FILES['Filedata'])) {
         $this->addException(APIErrors::MANDATORY_PARAMETER_MISSING, 'Filedata');
     }
     $filename = $this->getPM('filename');
     // strip the filename from invalid characters
     $token = $this->getKsUniqueString();
     // should upload the file with the token as the prefix
     $res = myUploadUtils::uploadFileByToken($_FILES['Filedata'], $token, $filename, null, true);
     $this->addMsg("result_ok", $res);
 }
Esempio n. 4
0
 /**
  * Upload a media file to Kaltura, then the file can be used to create a media entry. 
  * 
  * @action upload
  * @param file $fileData The file data
  * @return string Upload token id
  */
 function uploadAction($fileData)
 {
     $ksUnique = $this->getKsUniqueString();
     $uniqueId = substr(base_convert(md5(uniqid(rand(), true)), 16, 36), 1, 20);
     $ext = pathinfo($fileData["name"], PATHINFO_EXTENSION);
     $token = $ksUnique . "_" . $uniqueId . "." . $ext;
     $res = myUploadUtils::uploadFileByToken($fileData, $token, "", null, true);
     return $res["token"];
 }