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
2answers
4 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!
0
votes
0answers
10 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
13 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
50 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 ...
0
votes
0answers
6 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
10 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
10 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
58 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
19 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
37 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
12 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
26 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
12 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
27 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
14 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
16 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
22 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
20 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
27 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
28 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
26 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
109 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
56 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
19 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
83 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
32 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
15 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
23 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
35 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
12 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
23 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
32 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
64 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
52 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
22 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
25 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
44 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
vote
1answer
17 views

Dynamic Asset Sub Folder Paths based on section and. if/else or turnery operators

How can I create dynamic paths for asset uploads? Basically I want my structure to be like so; company-name-slug company logo-1.jpg image-2.jpg products product-image-1.jpg services ...
2
votes
0answers
93 views

How to Upload Multiple Assets Using Frontend Form

I'm trying to create a more interactive experience to upload moultiple images on a frontend entry form. Things I have done: I have implemented the code here: https://docs.craftcms.com/v3/dev/...
2
votes
1answer
34 views

{basePath} creates a folder named {basePath} issue

just built a blog with craft, and I got some issues with assets pathing. In the general.php I put return array( 'environmentVariables' => array( 'basePath' => '/images', ...
0
votes
0answers
35 views

Setting up assets path for live website

I just want to make sure I will do the assets pathing right, if someone could check. I have https://mysite.com and https://mysite.com/uploads as the folder where the assets should go. After I set my ...
0
votes
0answers
53 views

404 Error for assets where “Base URL” and “File system path” are different

I am new to Craft 3 and I have seen similar questions asked many but never answered. I want to store my images in a directory that is not public, yet I want them to be served correctly by Craft. The ...
1
vote
1answer
24 views

Sync existing local images Amazon S3

I installed "Amazon S3" in a website. Is there anyway so that I can sync existing local images to Amazon S3?
1
vote
1answer
51 views

Additional criteria to filter status of field passed into RelatedTo

I'm trying to save all the images related to an entry in a variable. I need the images that are added through a matrix field in the entry. I'm using the following code, but am then also getting images ...
0
votes
0answers
16 views

Updated S3 library for Craft CMS 2

I've got a site stuck on an older version of Craft, v2. I'd like to switch to using S3 to store all my assets but I've ran into a problem. I cannot authenticate using the S3 api library, this is one ...
1
vote
1answer
69 views

Forcing creation of all transformations for all assets

Regarding a similar question I only found the advice to delete a table in the database but because I don't like fiddling with the db very much I like to ask: Are there ways to force craft to generate ...
0
votes
0answers
37 views

Specify an asset volume for a file input on a front-end entry form

Is this possible? I want to specify the volume and/or folderId via hidden input, not just use the default. Nothing documented here: https://docs.craftcms.com/v3/assets-fields.html#uploading-files-...
1
vote
1answer
46 views

How to reference a folder inside of a volume, Craft 3

How do I reference a specific folder (by name) inside of a specific volume. I cannot use the folder ID, I must use the folder name because the name of the folder is a variable related to specific ...

1
2 3 4 5
16