By admin , 31 October, 2023 Autorotate images using EXIF data Install imagick module and enable it as default image toolkit.Add custom code: Tags file image imagemagick exif
By admin , 25 October, 2023 Delete temporary files after (via cron) $config['system.file']['temporary_maximum_age'] = 60; //seconds Tags file
By admin , 5 July, 2023 Create file entity programmatically use Drupal\file\Entity\File; $file = File::create([ 'filename' => basename($filepath), 'uri' => 'public://my-dir/' . Tags file
By admin , 28 February, 2023 Download files from array of links, create File entities and attach them to node $files = []; $index = 1; foreach ($pictures as $picture) { $filename = 'image_' . $offer_id . '_' . $index . '.jpg'; $destination = 'sites/default/files/product-photos/' . Tags node file guzzle
By admin , 24 February, 2023 Get file URL Get file URL without domain /sites/default/files/import-xml/export_w0h_2.xml$file = $this->entityTypeManager->getStorage('file')->load($fid); $file_url = $file->createFileUrl();Get file URL with domain and protocol$file_url = $file->createFileUrl(FALSE); Tags url file