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
0
votes
0answers
11 views

Can't delete sub folders

I have an issue where I cannot permanently delete a sub-folder from the "Assets" section in the control panel. When I delete the sub-folder, it does delete, however after logging out or a ...
1
vote
1answer
10 views

How to hide the assets section of the control panel to specific user groups?

I need to hide the assets section of the control panel to a given user group. Changing the group permissions to prevent them from viewing all asset volumes also prevents them from uploading assets in ...
1
vote
1answer
37 views

How do you insert the site name into a default asset path?

Multisite question.... how do I output the site into the assets path? currentSite won't work because its the admin panel, so the current site is always the default site. Using the below, I will always ...
1
vote
1answer
24 views

Get image asset relative url

I'm using image transforms and getUrl() method to display an image. I'm using Blitz to export my site as a static website. My problem is that .html pages get cached with images that have full urls ...
0
votes
0answers
21 views

Trouble generating correct srcset sizes using getSrcset()

I'm trying to figure out the getSrcset() method, going by the docs here. When I try it using the code in that example (I modified to account for a Matrix field but other than that it is the code below)...
2
votes
1answer
14 views

Deleting one or all Assets from a fieldusing a front end form

Good afternoon All, Im trying to setup the ability for users to delete 1 or more of their own images from a multi photo asset field and have got stuck. This is what is have so far, I assumed adding a ...
1
vote
1answer
18 views

Display list of assets that are in use?

I am very new to Craft and how it works. I've got a client with a Craft site (v2.9.2), that I help them with. It was created by another developer. I want to help them tidy up their Assets. There are ...
0
votes
0answers
7 views

How to empty the Temporary Uploads folder and why can individual users not delete files within up this folder?

I am perhaps over looking something, but I cannot see anyway for an back-end user (not admin) to be able to remove/clean up their Temporary Uploads folder. As a full admin, I see the option to remove ...
1
vote
1answer
19 views

Does deleting an original asset but keeping the transform folder asset make Craft replace the original file with the biggest transform?

I have a client who has uploaded many giant images to the CMS (8mb+). I'd like to free up that space now that those image have been transformed to more web-friendly sizes. Is it safe for me to delete ...
0
votes
0answers
7 views

Updating uploaded assets directory structure

How can i update uploaded assets directory structure, when i change assets field "Default Asset Location" settings - so files match this new setting? I have so much files all in one ...
0
votes
0answers
27 views

What’s the pattern for Entry Form inputs for Assets meta data fields?

The templating pattern for Entry Form inputs for Assets files is clear enough. But how can I provide inputs in an Entry Form for meta data pertaining to an Assets file? For example, I have fields like:...
1
vote
2answers
29 views

How to Get Asset Volume Name

Trying to figure out how to get the "name" and "handle" of an asset volume, given the volume ID. Tried all the obvious things, no luck!
1
vote
1answer
31 views

Create folder in asset volume via GraphQL

Is it possible to create a subfolder within an asset volume via GraphQL? If yes, can you point me in the right direction? I just found mutations for file uploading, but nothing for folder creation. ...
0
votes
0answers
17 views

Migrating assets from remote volume (Cloudinary) to local folder

I need to migrate an asset volume from Cloudinary to local folder. What is the appropriate strategy to execute the change while maintaining database integrity? Can I simply change the volume type to ...
2
votes
1answer
54 views

How to detect white background

In my product catalog, some product images need to have the css attribute object-fit: cover while some need the object-fit: contain: I'd like to detect the white background, possibly on upload (to ...
1
vote
1answer
39 views

Viewing Assets (PDFs) associated with an entry directly from that entry screen

I have a channel with an Assets field, designed to hold PDF files. It works fine to select one or more files, and/or upload files and select them. However, I'm wondering if there is a way to view a ...
0
votes
0answers
11 views

Can't list S3 buckets from Craft behind a firewall

We are using Craft2, and want to move the assets to Amazon AWS S3. We have two instances of Craft2, one on AWS, and one on a onprem server. The bucket is made (and is on eu-west-1) and the IAM user ...
0
votes
0answers
12 views

Entry ancestors is null in dynamic asset subfolder path or during EVENT_AFTER_SAVE event

I'd like to use the slug of the top-level entry in a structure in an asset's dynamic folder subpath. I have a structure where the entry I'm concerned with for this question can sit at either the ...
1
vote
2answers
73 views

Video Asset URLs not rendering

I'm trying to output the video files from within a block but get a Calling unknown method: craft\elements\db\AssetQuery::url() error when using the following: {{ block.video.videoFileWebm.url }} ...
1
vote
1answer
26 views

Loading assets cross-domain with SSL or non-SSL option

Here's a unique situation. I have three websites. All assets are stored at the domain of the first site: domain.com/files/* The first two sites run completely over SSL. No problem. The third site ...
2
votes
2answers
42 views

Enironment Variable being rendered literal

OK, So created 2 variables in my local .env file ASSET_BASE_URL="https://mysite.local/resources" ASSET_BASE_PATH="/Volumes/yada/yada/yada/resources" Then in the CP, created a new ...
0
votes
0answers
14 views

Event or hook to access when needing to show session messages via AJAX within Asset Events in the control panel

I am using EVENT_BEFORE_HANDLE_FILE on the asset class to moderate images before they are uploaded. I am setting session errors which show fine on the frontend templates on page refresh, however in ...
0
votes
0answers
89 views

Path to asset file shows “Template not found!”

I have a headless Craft CMS site and now the frontend development should start. I have absolutely no frontend or templates as I only worked on the backend. The asset url got created at /images. If for ...
0
votes
0answers
31 views

AWS S3 permissions issues with referrer conditions

I've got an odd situation happening with assets stored on AWS S3, which I'd appreciate some help understanding and resolving. Background Software Version: Craft CMS v2.9.1 All S3 assets were recently ...
1
vote
1answer
32 views

Set asset uploader from frontend entry form

Now that Craft keeps track of which user uploaded an asset, I'm wondering if it's possible to set this information when an asset is uploaded via a frontend entry form. I have a form that includes an ...
0
votes
0answers
20 views

Form field as 'Upload Location Subfolder'

Question concerning the Freeform plugin: Is it possible to set the contents of a text field as my 'Upload Location Subfolder' of a file upload field? I tried stuff like {{ form.customerName }} and {{ ...
0
votes
0answers
24 views

How can I get the dimensions of a video asset?

The video itself hasn't any dimensions (width and height) within its object. But Craft saves a thumbnail, right? How would I get to the thumbnail to get its width and height? Or is there something ...
2
votes
1answer
39 views

Only allow SVG as file type

I want to have an asset field which only allows .svgs. To be more specific, I want to upload icons I can later import in my templates via the svg() command. Is this possible without any plugins or a ...
1
vote
1answer
21 views

CP assets uploads are reverse ordered after upload

Problem CP assets uploads are reverse ordered after upload. Description I have a folder with 5 images: 1.jpg 2.jpg 3.jpg 4.jpg 5.jpg I want to upload these images in the Craft CP. I have an Asset ...
1
vote
1answer
30 views

Where does Craft store HTML Templates?

I have recently been given access to a Craft site's control panel. I need to edit the homepage to add data in the footer. As I didn't create the Craft website, how can I access the HTML I need to add ...
1
vote
1answer
34 views

How can I change the Date Created for Assets?

I'm using graphql to pull in some assets/pdfs and ordering them by dateCreated, however the files go back a few years (i.e. files from 2019, files from 2018 etc.) but they weren't uploaded in the ...
1
vote
2answers
32 views

How to upload asset element on its own, not into an asset field (frontend form)

I have read this resource about uploading a file to an asset field on an entry, but I believe I need to create the asset on its own because the asset has 2 custom fields associated with it that I want ...
2
votes
1answer
124 views

Protecting public assets

I'd like to manage access to assets with public URLs. Is there a way to set permissions for anonymous users?
0
votes
0answers
71 views

What's the recommended permissions configuration for AWS S3 media storage?

I'm hosting assets for Craft 2.9.3 site on AWS S3. I'm trying to figure out how to give the site (and its users) access to the files without making them broadly publicly available. I found a ...
1
vote
1answer
32 views

Front End Entry Form - File/asset field not saving when ajax submitted

I have a front end entry form which submits and saves fine when not using ajax. But when i do submit via ajax the text fields etc save fine but the file/assets field will not. I have stripped it right ...
1
vote
1answer
105 views

Work with data/content from entries

I'm usually working on Backends with PHP and ZF/Laminas. Now I'm building a headless (only Backend) Craft CMS website and have a couple of questions that I didn't find a clear answer on. The Craft ...
1
vote
1answer
43 views

Asset volumes with dynamic subfolder

I have an asset volume which uses dynamic subfolders on the field level. I have an assets volume called 'members'. In a matrix field on the user profile tab there is an image field that sets its ...
1
vote
1answer
18 views

Convert a PHP image resource to a new Asset

I am trying to merge two images and save it as a new asset and I am using the PHP function called "imagecopymerge" (https://www.php.net/manual/en/function.imagecopymerge.php) however thats returning a ...
1
vote
1answer
17 views

How is conflicting asset filename created

I upload files on the frontend using AJAX requests to actionUpload controller. When file is uploaded, I immediately display it using filename returned by controller. In case if filename conflict, ...
0
votes
0answers
24 views

Non-destructive image cropping plug-in

I am looking for a user-friendly, non-destructive way define an image crop when editing an entry with an asset field. Should be able to visually define an image crop Should be able to change the crop ...
2
votes
1answer
44 views

Uploading Assets - PNG changed from 72 dpi to 96

I've seen a couple strange things that Craft does when uploading images (like upsizing jpgs). The most recent, every time I upload a .png file it changes it's DPI from 72 to 96 for some unknown reason ...
0
votes
0answers
13 views

Assets Directory Usability When Editing An Image

I would like the CRAFT CMS to return to the current directory after I edit an image. Let's say I'm viewing a list of images in "assets > images > misc" I edit an image from that directory and then "...
1
vote
1answer
25 views

Outputting image assets with flickity

I'm trying to use flickity to create a draggable gallery on a single entry template, but I'm having issues with the output. In the backend it looks like this. A field using multiple assets. Without ...
0
votes
0answers
54 views

Is it possible to add a volume sub-folder that references an existing sub-folder?

The current physical structure of my assets folders consists of a base folder (uploads), and four sub-folders (banners, images, documents, speakers). Four volumes have been created in Craft, one for ...
1
vote
1answer
103 views

Calls to /actions return 400 Bad Request

I'm trying to use jquery ( and/or VueJS with axios) to delete an asset from a frontend form (user is logged in and they have permissions to delete assets from this volume) I have an HTML element that ...
1
vote
1answer
92 views

How to work getFieldValue for assets

I have been implementing my own PHP plugin code. In that, I need to get an asset field in user info. If I can get if the asset is set on the field or not, it is enough. I can get the values of text ...
1
vote
1answer
25 views

Image Upload & Editing Suddenly not Working

I'm getting an error on Image Upload and Asset Editing on an existing site. I'm getting the Upload failed. The error message was: “The file “.../storage/runtime/temp/...” does not appear to be an ...
0
votes
0answers
21 views

Assets out of web folder cannot be seen by non-admin user

I would like to put some assets out of web folder because of security reason. There is internal folder just under project root. The assets are surely put in correct folder. And, the assets are set on ...
0
votes
0answers
42 views

Asset URLs for transformed images broken after Craft 2 -> Craft 3 upgrade?

After a Craft 2 to Craft 3 upgrade a few months ago, I'm going back and cleaning up a few lower-priority issues left over from that. This is one of those. A number of entries have embedded image ...
0
votes
1answer
55 views

Import a large number of assets via feedme

I have 224,559 assets (images) I need to import and assign to entries. Assets are currently stored in folders that match their original asset id. Imported assets will be stored on s3. I'm using feedme ...

1
2 3 4 5
16