|
@@ -109,26 +109,26 @@ class Route_UrlAction_ProcesEditor extends RouteBase {// TODO: UrlActionBase @se
|
|
|
$vidExtList = array("video/mp4");
|
|
$vidExtList = array("video/mp4");
|
|
|
|
|
|
|
|
|
|
|
|
|
- $info;
|
|
|
|
|
|
|
+ $info = new stdClass();
|
|
|
|
|
|
|
|
$statement = DB::getPDO()->prepare("INSERT INTO CRM_IMAGE(NAME, TYPE, REMOTE_TABLE, REMOTE_ID, IMAGE, SIZE)
|
|
$statement = DB::getPDO()->prepare("INSERT INTO CRM_IMAGE(NAME, TYPE, REMOTE_TABLE, REMOTE_ID, IMAGE, SIZE)
|
|
|
VALUES(:NAME, :TYPE, :REMOTE_TABLE, :REMOTE_ID, :IMAGE, :SIZE)");
|
|
VALUES(:NAME, :TYPE, :REMOTE_TABLE, :REMOTE_ID, :IMAGE, :SIZE)");
|
|
|
|
|
|
|
|
if(in_array($type, $imgExtList)){
|
|
if(in_array($type, $imgExtList)){
|
|
|
- $content = 'data:'.$type.';base64,'.base64_encode(file_get_contents($url));//
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- $statement->execute(array(
|
|
|
|
|
- ":NAME" => $name,
|
|
|
|
|
- ":TYPE" => $type,
|
|
|
|
|
- ":REMOTE_TABLE" => "ADMIN_USERS",
|
|
|
|
|
- ":REMOTE_ID" => User::getID(),
|
|
|
|
|
- ":IMAGE" => $content,
|
|
|
|
|
- ":SIZE" => $size
|
|
|
|
|
- ));
|
|
|
|
|
|
|
+ // $content = 'data:'.$type.';base64,'.base64_encode(file_get_contents($url));//
|
|
|
|
|
+ $content = file_get_contents($url);
|
|
|
|
|
+ $statement->bindParam(':NAME', $name, PDO::PARAM_STR);
|
|
|
|
|
+ $statement->bindParam(':TYPE', $type, PDO::PARAM_STR);
|
|
|
|
|
+ $imageType = "ADMIN_USERS";
|
|
|
|
|
+ $statement->bindParam(':REMOTE_TABLE', $imageType, PDO::PARAM_STR);
|
|
|
|
|
+ $idUser = User::getID();
|
|
|
|
|
+ $statement->bindParam(':REMOTE_ID', $idUser, PDO::PARAM_INT);
|
|
|
|
|
+ $statement->bindParam(':IMAGE', $content, PDO::PARAM_LOB);
|
|
|
|
|
+ $statement->bindParam(':SIZE', $size, PDO::PARAM_INT);
|
|
|
|
|
+ $statement->execute();
|
|
|
|
|
|
|
|
$info->statusCode = 0;
|
|
$info->statusCode = 0;
|
|
|
- $info->statusText = "Plik załadowany pomyślnie" ;
|
|
|
|
|
|
|
+ $info->statusText = "Plik załadowany pomyślnie";
|
|
|
}else if(false && in_array($type, $vidExtList)){ //Only image files
|
|
}else if(false && in_array($type, $vidExtList)){ //Only image files
|
|
|
|
|
|
|
|
|
|
|