Questions tagged [assets]
Files managed by Craft, stored in physical folders or (with Craft Pro) on Amazon S3, Rackspace Cloud, and Google Cloud.
848
questions
1
vote
1
answer
40
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 ...
1
vote
2
answers
74
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: ...
1
vote
2
answers
65
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 ...
1
vote
1
answer
45
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 ...
1
vote
1
answer
18
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 ...
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 ...
2
votes
1
answer
62
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()...
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 ...
0
votes
0
answers
126
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 ...
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 ...
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?
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 ...
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
...
1
vote
2
answers
170
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 ...
1
vote
3
answers
296
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::...
1
vote
1
answer
159
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 ...
0
votes
0
answers
79
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": "...
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 ...
1
vote
1
answer
124
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 ...
1
vote
1
answer
48
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.
1
vote
1
answer
80
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' ...
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 ...
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 ...
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 ...
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 ...
0
votes
2
answers
247
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 ...
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 ...
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 ...
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 ...
0
votes
1
answer
86
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?
...
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
{% ...
1
vote
1
answer
890
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 ...
1
vote
1
answer
130
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/ . ...
1
vote
1
answer
513
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 ...
1
vote
1
answer
189
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.
...
1
vote
1
answer
284
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 ...
1
vote
1
answer
345
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 ...
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?
...
3
votes
1
answer
467
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 ...
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 ...
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 ...
0
votes
0
answers
89
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
...
1
vote
1
answer
514
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?
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 ...
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 ...
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
1
vote
1
answer
63
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 ...
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'...
1
vote
0
answers
180
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? ...
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/...