Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [assets]

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

0
votes
0answers
29 views

Large file upload, 500 server error

We've a Craft 3 site hosted with Digital Ocean (Serverpilot set-up) with the DNS routed through Cloudflare. The client has experienced issues uploading large ZIP files to (c140MB), returning a 413 ...
0
votes
1answer
32 views

Craft 3 auto-creates sub-folders in assets. How can I prevent this?

I use Google storage for photos. The Google storage volume is mapped to a bucket's subfolder. Unfortunately these appear as subfolders in assets, along with a set of repeated folder structure. I did ...
0
votes
0answers
61 views

Unable to upload files (mp4,MOV,pdf) to craft CMS

Need some help. All of sudden our Craft (2.6.2993) is giving major issues. Unable to upload any videos and pdf. However we can upload small size images. When the size of the image increase, its the ...
2
votes
1answer
19 views

Multiple Asset source question

I'm creating a new Craft 3 site and migrating a lot of content from a wordpress setup. I'm wondering if it is better to separate assets into more sources - thus reducing the number of files per ...
0
votes
0answers
16 views

Multisite & Assets

I am fighting with my multisite configuration here. So I have to Sites, one is running in the 'web' folder, the other one in 'web2' folder. So now I have a file field 'featuredImage' that is used ...
1
vote
1answer
18 views

Sideloading an image from a function in a plugin

I need to be able to side load an image and attach to an entry. My image is coming from an external url... such as http://someplace.com/image.jpg - i can store this in a temporary file so its locally ...
2
votes
1answer
20 views

How to rename filename of asset before (or after) upload in Craft 3

I want to change the filename before the file is stored, to prevent ugly, long and weird filenames uploaded by users. I've found an example for Craft 2, but because of the changes for events I can't ...
1
vote
1answer
15 views

How can I fix Image Exception error when uploading image via front-end form while Preparse plugin enabled?

I'm not sure if the issue is with Craft 3, the Preparse plugin, or me, so I'm posting here first. I have a front-end form that includes an Assets field used to upload images. The entry type contains ...
1
vote
1answer
49 views

How can I rename an asset file on upload when an entry is saved (Craft 3)?

I have an entry type that includes an Assets field. When this entry is created/saved via the CP or a front-end form, I want to rename the Asset file as follows: Entry's author id. E.g: 148 01, 02, 03 ...
0
votes
1answer
19 views

Update Asset Indexes gives “getFileList() is not implemented”

Thank you in advance for any tips on this. Barely-related-background: I made a mistake on my development machine. In gparted, I chose "ignore" instead of "cancel". This is called 'choosing poorly'. ...
0
votes
0answers
22 views

How to save a file to an asset folder from the frontend?

I have a frontend canvas element that users can draw on that outputs as an SVG. If the users clicks a share button I want to save that SVG to an asset folder to then display a collection of all the ...
1
vote
1answer
17 views

Push/Add asset to Entry by asset filename

I have spreadsheet that i'm parsing and I have available to me a Entry ID and the Asset filename. Can I add the asset to the entry by the filename? Im targeting the product entry with: $product = ...
1
vote
1answer
17 views

API - Update Asset Volume

Im trying to figure out how to move asset(s) to a different volume. Also if I move it will that affect the entries that are using the asset? Here's what im using to target the asset: $resourceImage = ...
1
vote
1answer
21 views

Permissions needed to “edit image”?

What permissions do users need in order to access the "edit image" menu in assets? Some users can't access this, but I can't see a specific permission for this listed under: Settings > Users > User ...
0
votes
0answers
25 views

Custom plugin: asset fieldtype

I have a custom plugin that uses a custom field leveraging the elementSelect fieldtype to select an asset (which is then processed on submission via a custom service). However, when I select an asset ...
1
vote
1answer
36 views

Asset integration with Microsoft Azure Storage in Craft 3

I'm developing a site using the Craft 3 and I can't figure out how to connect assets with Microsoft Azure Storage. I found plugin for Amazon S3 but not available similar plugin for azure. Any help ...
0
votes
0answers
35 views

Uploading new assets gives “file already exists” error

My client's found that Craft is often giving her the following alert when uploading a new asset: A file with the name “image_name.jpg” already exists. I've tried renaming images to something ...
1
vote
1answer
17 views

Is there any way to replace the asset programatically?

In the CP, when we upload an image with a same name, craft will ask if we wanna keep both or replace. So in plugin, is there any way to do the replace?
1
vote
1answer
20 views

Craft strips out parenthesis in file names.

Is there any way to allow () in asset file names (ex. file(1).txt)? Craft strips it out when it saves. The only way I've found is to change it via ftp and update asset indexes. I've set ...
2
votes
0answers
43 views

How to setup assets in multi site where each site should have its own assets?

I have a setup with multi sites that are separate domains. site-a.com site-b.com I would also like to have assets separate for each site, like so: site-a.com/images/picture1.jpg site-b.com/...
1
vote
1answer
32 views

Plugin development: how can I check if user has the permissions to delete only his own assets?

I have a front-end form where logged users can upload and delete their personal files. These users have the strict minimum permissions required to interact with this form. They can only Create, ...
0
votes
0answers
35 views

How to upload an image to an entry?

In front-end, I have a file input field with the name headerImage. <input type="file" class="form-control" name="profileImage" accept="image/*"> At the back-end, I do something like this: $...
1
vote
2answers
54 views

background-image CSS property: how to do it right with Craft?

My current code is: #header { background-image: url('{{ sitePath }}/assets/toxicomental/header.png'); height: 150px; } Still, I don't get the image showing. What do I do wrong?
1
vote
1answer
34 views

Pull all assets from a specific volume subfolder id

Is there a way to pull all assets from a volume subfolder id? {% set entries = craft.entries.section('pages').type('genealogy').search('pageType:stake') %} {% for entry in entries.all() %} {% if ...
1
vote
2answers
30 views

Assets metadata: Matrix required?

I'd like to add very basic metadata to assets (Alttext, Caption..) I noticed in volumes you can add custom field types – but they're not appearing when editing the entry. I found it can be edited in ...
3
votes
1answer
41 views

Temporary Uploads - disable?

When browsing the assets, there is a "Temporary Uploads" folder. What is it for? Can I disable/hide it?
0
votes
1answer
58 views

Asset (image) public URL does not work

I wanted to include some uploaded assets (images) in an entry. The .url property in twig outputs the proper URL, in my case: http://localhost/craftcms/web/image/photo-2017-04-02-16-20-53-1.jpg ...
2
votes
1answer
28 views

How to get second asset?

I have an entry with an asset field that has up to 3 assets in it. If I want to load just the second asset in my template code, what's the syntax for this? (can't find any references/examples)
1
vote
1answer
21 views

How to create a border + border colour field on an image

My first question here... maybe one of a few! I've inherited a Craft project recently and don't have much experience with it. I want to allow admin to set a border (and border color) whenever they ...
0
votes
0answers
15 views

JPG assets won't upload with image driver GD

I'm really not sure what's going on here. The server has GD extension installed as the image driver. I cannot install imagemagik, it's outside of my control. Image assets like .png and .gif upload ...
2
votes
1answer
33 views

How to exclude child elements when looping through categories?

I've got a few categories set up with a few child categories for each. Each one has assets (PDFs) assigned to them, by going into the assets, double clicking, and setting the category field there. So ...
3
votes
1answer
35 views

Moving Craft assets from one S3 bucket to another

I have the task of moving a large amount of assets ~50gb from one amazon s3 bucket to another on another AWS account. I've figured out how to copy the files via S3 COPY, but I'm just wondering will it ...
0
votes
0answers
32 views

I can access an asset filename, but not its URL

At first I was trying to use the one(), but it always told me the Object of class Craft\ElementCriteriaModel could not be converted to string So searching the documents, I found first(), and that ...
1
vote
1answer
25 views

How to display a featured image in the list of entries

I created a field which uploads an image, and I want it to display it for each of my entries inside my for loop. What's the code I should use to do it?
1
vote
1answer
14 views

How can I prevent CMYK image colours being shifted when importing into Assets?

When importing CMYK images into Assets the colour of the image can be shifted dramatically. Often giving a washed out look. How can I prevent this and ensure the image colours are as accurate as ...
0
votes
0answers
19 views

No preview on active list

I'm having an issue once I want to pick one asset from all the uploaded assets list, due to I'm not able to view the preview thumbnail. Edit feature doesn't work either. Here you have an screenshot: ...
1
vote
0answers
32 views

Find All Levels of Subfolders under Assets

I'm working with images in subfolders, several levels deep, under the Assets parent folder. -Assets --Dept_A ---Jan15 --Dept_B ---Jan15 ---Jan16 I've come across this code (below), but it only ...
0
votes
0answers
41 views

Asset Subfolder Access (By P&T) - Subfolders of Subfolders?

I'm developing my first site and am using the Asset Subfolder Access (By P&T) to restrict uploads to Assets and subfolders. As I have subfolders of subfolders, I was wondering if it is possible to ...
1
vote
1answer
45 views

Getting image url from globals asset field

I can retrieve only the image title from the below code, I can't see why the image URL is showing as empty? its a global handle 'brand' and asset field 'logo': {% set image = brand.logo.one %} <a ...
1
vote
1answer
31 views

.limit(1) on asset field loop is effecting another loop on same page

I have an Asset field where the first image is used as a big 'feature' and then the rest are used as support further down the page. When I add .limit(1) to the for loop for the 'feature' image it ...
1
vote
1answer
27 views

Uploading assets to different locations based on environment

I'm currently working on a new Craft CMS website for my company. We're using Elastic Beanstalk for hosting, which means that saving assets to file on the server isn't really viable- they get ...
1
vote
1answer
69 views

Output assets within a matrix block using Imager and Craft 3

I'm having trouble trying to output assets from an Assets field that's within a Matrix block, using Imager. The code below is only outputting the first image that has been added, over and over for ...
0
votes
0answers
15 views

Localization for asset folders (craft 2)

I've built a "documents" section with subfolders. The page is offered in 3 languages, that's why I made 3 asset sources for each language. Then I wrote a tiny plugin for grabbing the directory ...
1
vote
1answer
53 views

getPath() does not return subfolder for S3 asset source

I'm reading through the Craft docs in relation to the AssetFileModel. Looking at the getPath() method, this reads in theory that it should return the full path to the asset relative to the root, ...
0
votes
0answers
33 views

Include the asset's volume in the eager loading. [Element API]

On Element API, I'm eager loading the header image like: $criteria = [ 'section' => $section, 'with' => ['categories', 'header_image'] ]; But, in the output, I cannot get the volume ...
0
votes
0answers
61 views

Managing assets on a blog-type multi-site

Im currently building a multi-site blog solution in craft 3. The idea is to have one site per blog and let all the blogs share the same fields with some variations in the templates based on their ...
2
votes
2answers
56 views

Craft 2 to Craft 3 upgrade: User Photos not migrated to User Accounts

I followed the instructions in the docs at https://docs.craftcms.com/v3/changes-in-craft-3.html#user-photos. I can browse the User Photos in the User Photos Asset Volume in the Control Panel. However,...
2
votes
1answer
104 views

“An unknown error occurred” in assets screen

I have a number of assets resources all set to upload to the same amazon s3 bucket. Two of my four assets resources show "An unknown error occurred" twice when I view them in /admin/assets. The ...
1
vote
1answer
19 views

Falling back to Parent Category if no asset exists

I'm trying to make it so that if an entry image does not exist, then fall back to the category image that the entry belongs to. Right now this isn't working and is receiving an error. {% set feature =...
1
vote
1answer
62 views

Deleting a user's profile photo via frontend in Craft3

I am having the hardest time allowing a user to delete their profile photo with Craft3. I have tried to follow this thread's answers : Allow user to change or delete their photo for their profile from ...