Crowdland Technology

Starter
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Crowdland Technology

  • Rank
    Newbie
  1. Crowdland Technology

    Hi! The is no problem in version 1.0.9. This is my code. if (isset($_POST['galeria'])) { // process form input $formGaleria->processInput($input->post); if (!count($formGaleria->getErrors())) { // if no error occured // create new page and save values $uploadpage = $pages->findOne("template=db-propiedad,id=$idPropiedad"); $uploadpage->of(false); $files = explode("|", $formGaleria->get("imagenes")->value); $targetWidth = 1024; $targetHeight = 768; foreach ($files as $file) { if ($file && file_exists($upload_path . $file)) { $filenameOrig = $file; $options = array('upscaling' => false, 'quality' => 100, 'sharpening' => 'soft'); $imageSizer = new ImageSizer($upload_path.$filenameOrig, $options); $success = $imageSizer->resize($targetWidth, $targetHeight); if($success) { $uploadpage->imagenes->add($upload_path . $filenameOrig); } unlink($upload_path . $file); } } $uploadpage->save(); $session->redirect($pages->get("/crm/propiedades/imagenes")->url . $idPropiedad); } else { // form incomplete or errors happened // we remove uploaded files $files = explode("|", $formGaleria->get("imagenes")->value); foreach ($files as $file) { if ($file && file_exists($upload_path . $file)) { unlink($upload_path . $file); } } $formGaleria->get("imagenes")->value = ''; // reset field value } }
  2. Crowdland Technology

    It worked. Thank you! Only this warning remaings but not sure why. PHP Warning: filemtime(): stat failed for D:/var/www/realhomecrm/site/assets/files/1319/andorra-729795_1280.jpg in D:\var\www\realhomecrm\wire\core\Pagefile.php:524
  3. Crowdland Technology

    Thank you Adrian, I tryed it and now the error is: Parse error: syntax error, unexpected 'if' (T_IF) in D:\var\www\realhomecrm\site\assets\cache\FileCompiler\site\modules\ProcessCustomUploadNames\ProcessCustomUploadNames.module.php on line 177
  4. Crowdland Technology

    Hi! There is a problem trying to upload a file from a custom frontend. PHP Warning: count(): Parameter must be an array or an object that implements Countable in ...\ProcessCustomUploadNames.module.php:176 I have this problem since v. 1.1.0. So I had to rollback to 1.0.9. The file is saved on the disc but not on the database. My setup is: Apache 2.4 Php 7.2.6 PW 3.0.120