Questions tagged [assets]

Files managed by Craft, stored in physical folders or (with Craft Pro) on Amazon S3, Rackspace Cloud, and Google Cloud.

Filter by
Sorted by
Tagged with
1 vote
1 answer
41 views

Image path is broken after updating site from Craft version 3 to 4

I am currently in the process of upgrading my site from 3 to 4. My craft CMS version is 4.4.16.1 None of my images are loading in the site after performing update. Our images are stored in AWS. Upon ...
Sajjan Shrestha's user avatar
1 vote
2 answers
75 views

Uploading (multiple) assets to assets controller via front end with Craft 4

I'm trying to upload assets directly to a volume using the 'assets/upload' controller in a front-end form. There must have been some changes since Craft 3 and I'm running into 2 issues: Issue 1: ...
MetaMachine's user avatar
1 vote
2 answers
69 views

Adding an assets image URL field to an RSS feed

I am creating a RSS feed from a news channel and I have gotten it all working except for the news story image which is an assets field. I want to pass the url of the image so I can pull it in via feed ...
bhackett's user avatar
  • 127
1 vote
1 answer
48 views

Can't delete asset subfolder

I just created a subfolder to test how it works but now can't delete it. If I select it and then click the "options wheel" in the bottom, the delete button is disabled. Is there another way ...
obs's user avatar
  • 487
1 vote
1 answer
19 views

How is it possible to upload photo directly from mobile phone/webcam and link it to an entry?

I would like to take photos on a mobile phone/webcam and upload them automatically when the photo is taken. Currently, I'm taking photos have it saved on my local desktop and upload them manually to ...
Carl's user avatar
  • 11
1 vote
2 answers
60 views

GraphQL queries for srcset

I am trying to fetch srcset with GraphQL from Craft4 but I don't really understand the syntax. In my twig Templates I use image.getSrcset(['1x','2x'],'myTransformHandle') and I'm trying to translate ...
thomas's user avatar
  • 131
2 votes
1 answer
66 views

PDF with Content-disposition: inline; only works with devMode ON

This works fine with devMode(true), but not when false. I'm calling it as a craft variable {% do craft.mymodule.pdf(entry) %} public function pdf(Entry $entry) { $asset = $entry->asset->one()...
Leoncio's user avatar
  • 463
0 votes
0 answers
19 views

New install, re-indexed Amazon S3 folders, Craft not creating/finding transforms

Yesterday I re-indexed the contents of my image library on Amazon S3 to a fresh install. I can see the images in Assets, I can use the images in entries and then tags/templates, I can import entries ...
Emma Swann's user avatar
0 votes
0 answers
130 views

Error while trying to create Assets/Asset Volumes

If I try to create a asset field, a server error occurs when I select the Field type "Asset" and I can't edit it further. I also can't edit my Assets because when I click on it I get an ...
Lucas's user avatar
  • 1
1 vote
1 answer
26 views

Assets display changed, cutting off folders

I am not yet able to upgrade to Craft 4 due to some plugins used regularly not being ready, but on updating 3 to a newer version a few weeks ago, noticed the way asset folders were displayed - both on ...
Emma Swann's user avatar
1 vote
1 answer
41 views

How to get second asset in Craft CMS 4?

In craft cms 3 we could use this: {{ entry.images[1].url }} But how can I get second asset in Craft CMS 4?
Nikolay Bronskiy's user avatar
1 vote
2 answers
65 views

Showing related assets referred to within Redactor (rich text) fields

When an entry includes a reference to an asset, like an image, that information is tracked and displayed. (The included screenshot shows where that reference would be, although this particular entry ...
4midori's user avatar
  • 656
0 votes
0 answers
45 views

Is it possible to restrict a File System’s or Assets Volume’s file type?

I think I know the answer to this is “No” but I’m interested to know if I’ve missed something or whether I should turn this into a feature request. I know I can restrict file type for an Assets field ...
Jonathan Schofield's user avatar
1 vote
2 answers
172 views

Asset Indexing is frozen and I can't discard the task

I'm using Craft 4.3.6.1 and a DigitalOcean Spaces filesystem. On the Utilities > Asset Indexes page, I clicked "Update Asset Indexes" button. A procress started and got about 3% done ...
sea_monster's user avatar
1 vote
3 answers
301 views

Change asset title and filename on upload

I'm trying to rename files uploaded by users on the frontend. Changing the title is working, but I can't rename the file. Would appreciate some help! Event::on( Asset::class,Asset::...
supazu's user avatar
  • 564
1 vote
1 answer
163 views

Prepopulating image fields - Formie Plugin on Craft 4

I have a front end entry form for users to update their entry. It's built using the Formie plugin. I need the fields to prepopulate with the current entry content. According to the Formie docs fields ...
George Bleasdale's user avatar
0 votes
0 answers
80 views

Feed Me: import Assets custom fields data while importing new Entries

I have a JSON feed that import new Entries. In the imported fields, I have an image Assets field which is set up to create assets from their URL. "cover": [ { "url": "...
Romain P.'s user avatar
  • 1,798
1 vote
1 answer
98 views

How to get list of pages where the asset is used?

I have a list of assets link with assets id. eg: 23453 => 'https://some_cool_domain/assets/file_name.jpg' I need to find all the pages where this asset is being used. I am new to craftcms. I tried ...
Suman Bhandari's user avatar
1 vote
1 answer
126 views

Retrieve storage path of image transform instead of URL

I'm generating base64 encoded strings of very small image transforms to display a blurred version of images while the bigger asset is loading. I'm trying to get the cached transform path (if it ...
Capsule's user avatar
  • 131
1 vote
1 answer
49 views

Detect on which entry / entries an asset is inserted

Is it possible to display in the asset overview on which entry / entries an asset is used? So that when I go into an asset, I have an overview of the entries where that asset is inserted.
ChuckLean's user avatar
1 vote
1 answer
82 views

Set asset volume dynamically via module depending on uploaded file kind

I'm trying to set the asset volume dynamically for new assets, using a module. I would like the volume to be based on the asset's file kind – in my case, automatically putting MP4s into a 'Videos' ...
Josh Harrison's user avatar
0 votes
0 answers
51 views

AWS Load Balancer - Assets Uploads

We have two ec2 instances and a private IP db instance along with a Amazon Load Balancer. Is there a way to upload images on CraftCMS domain pointing to a load balancer? Right now the assets image ...
Noor M's user avatar
  • 1
0 votes
1 answer
46 views

How to enforce subfolder names for uploaded assets in hierarchical related sections

My goal is to ensure uploaded videos are organized into folders like: /Show/Season/Episode/videofile.mp4 Or stated another way... /{{ Show ID of grandparent }}/{{ Season ID of parent }}/{{ Episode ...
Jim's user avatar
  • 139
1 vote
1 answer
140 views

How to rename an asset on file upload Craft 4

I am looking to update some custom module code which updates the file name on upload. In Craft 3 I had this working by listening to the EVENT_AFTER_SAVE on an Asset. It would detect the ID of the ...
zizther's user avatar
  • 449
1 vote
2 answers
163 views

Is there a way to block access to assets by url?

This will probably not be possible, but here goes nothing: I have entries that are password protected using the Template Guard plugin. While this does work perfectly, this does only password protect ...
fr-haus's user avatar
  • 58
0 votes
2 answers
250 views

Get Entry Slug from specific Locale

I have a multilingual entry setup using different sites for each language. I want my assets sorted by slug, but since the slugs are different in each language, all assets are saved three times. My ...
Sandro's user avatar
  • 43
0 votes
1 answer
82 views

Multiple image are automatically created?

I am using Craft 4 and I noticed after uploading an asset, additional folders are created automatically with multiple sized versions of the same image I uploaded. This causes a lot of additional files ...
Darthrizen's user avatar
1 vote
1 answer
48 views

Craft changing/corrupting assets on download?

I have a problem with downloading files from Craft CMS using the "download asset" action on the asset page in the control panel. These files don't have a public URL and needs to be ...
Slebbo's user avatar
  • 87
0 votes
0 answers
44 views

Query multiple users and inner join to assets field

How to query multiple users and join to assets field? I want to query users with IDs [1,3,4] and inner join it to assets field with volumeId 5 and titles [1,3,4]. Tried this but this is probably wrong ...
tenshi's user avatar
  • 101
0 votes
1 answer
87 views

Transformed JPGs have larger file size than original

Question Why is it that sometimes a transformed JPG is larger than its original when it is transformed using Craft image transforms even though in my general.php file I set upscaleImages to false? ...
fr-haus's user avatar
  • 58
1 vote
1 answer
51 views

Craft 2 Looping Through Assets Limit 100

In Craft 2, I am looping through Image Assets, but the loop stops after 100 images. I currently have around 140 images, but only the first 100 appear. Is this a built in limit in Craft 2? Thanks {% ...
buck1112's user avatar
  • 390
1 vote
1 answer
897 views

Craft4 stream_copy_to_stream(): Argument #2 ($to) must be of type resource, bool given

As mentioned in the title, I'm not able to upload any files in Craft4. I created a filesystem and a volume which is connected to the filesystem. In the assets-field settings I added the volume. I have ...
mcoze's user avatar
  • 41
1 vote
1 answer
134 views

Hosting and permission problems

It's my first time deploying CraftCMS and I ran into some issues which I don't seem to fix. I'm using Combell to host my website. I can only access my site when I go to "sitename".be/web/ . ...
Knz-dw's user avatar
  • 11
1 vote
1 answer
518 views

Why am I getting, 'Unable to write stream to' error when uploading asset?

I set up Fortrabbit object storage but when I go to upload an image in 'add asset' I get this error in a pop up; Unable to write stream to 'fileName' When I try to upload it with 'upload asset' the ...
Zack Reid's user avatar
1 vote
1 answer
192 views

How do you upload an asset via an API or GraphQL

Is it possible to upload a new asset via some POST request to craft's API? Or maybe through a graphql mutation? I noticed in the public schema there is the option for Creating assets within a volume. ...
nikolaj frey's user avatar
1 vote
1 answer
286 views

What's the correct way to check that an asset file exists?

If I have an asset resource, loaded successfully from the database, whose corresponding file no longer exists on its Volume (irrespective of Volume type), what is the best way to find out if the file ...
tomkiss's user avatar
  • 43
1 vote
1 answer
354 views

Creating an asset from an API using a module

I'm currently making a module that I'm hoping is going to create entries and assets from an API. I've got the entries part working and now I'm trying to create an asset from a URI of an image. I've ...
Jack Nixon's user avatar
1 vote
1 answer
40 views

How can I use a transform on images in a body field that have been imported?

I have imported content into an old news entrytype for a news channel. The odd image in the body field is 4000px wide. Is there a way of automatically transforming these in a template or from the CLI? ...
joomkit's user avatar
  • 2,004
3 votes
1 answer
474 views

Eager loading categories and assets inside related entries for gallery

I am looking for some advice on how to best streamline a gallery system on a site, but having trouble wrapping my head around the syntax needed to eager load nested asset fields with categories inside ...
sonoflee's user avatar
1 vote
1 answer
18 views

Asset has a child category but only displays the parent on templates

I have an asset volume that has a category field. The category field has no max level so I can have parent/child categories. If I set a child category to the asset in /admin then all is well, but when ...
Jaytrix's user avatar
  • 187
0 votes
0 answers
206 views

Upgrading Craft (and docker image) now causes SIGSEGV core dumps and problems with mutex locks

I just upgraded to 3.7.27.2 (as an intermediate step) and since I'm always deploying with the latest docker image (craftcms/nginx:7.4) I have also gotten the latest expat upgrade. I'm not sure where ...
jishi's user avatar
  • 263
0 votes
0 answers
90 views

How to save the selected assets in custom module

I am trying to create a custom module where I have created an asset uploader field. Images are getting uploaded with that field but not saved. class Settings extends Model { // Public Properties ...
Eira's user avatar
  • 1
1 vote
1 answer
519 views

Get the width and height of videos

I need to get the width and height of videos to calculate some aspect ratio. Craft doesn't do this out of the box. Any plugins that does this? Or can i write my own?
J. Sveum's user avatar
1 vote
1 answer
179 views

Asset Custom Field Returning Null in Array

I am relatively new to Craft CMS and I have encountered an issue that I have attempted to debug for quite some time. When using the {% dd %} function to dump my array, a load of my custom fields ...
NodeCreative's user avatar
1 vote
1 answer
101 views

Display entry field if it contains search query

Is it possible to display an entry field in search results if it contains the search query? Context: I have an entry with a list of PDF assets. I want to show an asset in the search results if it ...
Andrew's user avatar
  • 13
0 votes
1 answer
251 views

Want to use assets field my template settings in custom plugin craftcms

I am creating a plugin that is based on images the admin will upload some sort of images in plugin settings not sure how to creat image field setting in plugin
DTS's user avatar
  • 23
1 vote
1 answer
64 views

Remove dynamicly transformed images

Is it possible to remove/delete all, via transformer, generated images? Leaving the original be. Craft creates new directories to handle these images. So i could create a script in combination with a ...
Leonardo's user avatar
  • 419
0 votes
0 answers
28 views

Local Volume Folder: Transliterate path, but keep name as is

Intention: create a local Asset Volume with a bunch of subfolders and files in it and display a file tree on frontend. All OK, but since the website is in German, I have to do 'convertFilenamesToAscii'...
anvar's user avatar
  • 67
1 vote
0 answers
182 views

How to save custom field for asset field in entry form

I have an entry form that includes an asset field called photoHalfBlock. The asset field has its own custom field called photoType. Can I set a custom field on the asset as part of my entry form? ...
Michael Todd's user avatar
1 vote
1 answer
143 views

Asset Indexing breaking images

My client hit the update asset indexing button in the settings panel and now the images are all appearing broken. Can you suggest how to fix this? Example image: https://cookproperty.co.nz/assets/...
Tim's user avatar
  • 29

1
2 3 4 5
17