Questions tagged [assets]

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

84 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9
votes
0answers
781 views

How do I upload images programmatically?

I'm working on a plugin that creates auto crops of a selected image, but I am unsure of the proper steps to create and upload an image programatically. I am hoping that Local asset sources and Remote ...
6
votes
0answers
263 views

Solspace Freeform Upload file dynamic location and duplicate file avoidance

Using Freeform for forms which have multiple file upload fields. Is it possible to have a unique asset directory for each submission? For example: uploads/maindirectory/submission.id/ I'm trying to ...
3
votes
0answers
326 views

Restrict each user to a single Assets folder

I need every control panel user to have a single assets folder that is private to them. Is there any way of achieving this in Craft? I've tried using the "Restrict uploads to a single folder?" option ...
3
votes
0answers
142 views

Image transforms directory not being created

I've upgraded to El Capitan from Yosemite, created several Image Transforms in the CP (see pic) but they don't seem to be creating the folders in the uploads dir. I've checked folder permissions for ...
2
votes
0answers
116 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
0answers
323 views

How to download private assets (without public URL) from dashboard

I would like to download asset files from Craft 3 dashboard. Those files are out of web folder because of security reason. I made "documents" folder just under the root of the project, and the files ...
2
votes
0answers
169 views

Move an asset to another volume with volume specific OptimizedImages Field and on the entry a volume restricted Asset Field

I have three volumes: content, hero and overview. Each volume has his specific OptimizedImages Field(s). Asset Fields are restricted to its specific source volume. For example: A Super Table Field ...
2
votes
0answers
34 views

Carry over asset field content to other locales

I have a site with English and French locales. One of the fields we have assigned to our entries is an asset field. Currently when an admin adds a new entry, all the English content will carry over ...
2
votes
0answers
113 views

“Missing” assets from large S3 asset source

We have an S3 asset source with ~33k images. In the admin, quite a few aren’t completely loaded (see image below). Users are able to add these to entries but they don’t display on the front end. ...
2
votes
0answers
423 views

Can't find assets publicly via URL

Basically, I have an asset volume called Images, with base URL: /photos/ file system path: ~media/images Then I go to upload the asset and I try to view it, it gives me a 404 "Template not Found" ...
2
votes
0answers
440 views

asset.getUrl() outputs double slashes

Craft hasn't done this prior (or maybe I just noticed), but I'm currently battling double slashes in URLs returned from {{ asset.getUrl() }}. The issue appears when I create an Assets field and set ...
2
votes
0answers
169 views

Manipulating CP Elements List view with source filtering does not work for assets

I made a plugin which customize columns table view for all my elements and using a filter on the source : Entries: section public function modifyEntryTableAttributes(&$attributes, $source) { ...
2
votes
0answers
121 views

How to seperate asset folders by locale?

I have a website where the client can add links to assets (pdf, doc, etc.) anywhere on a page. So I would like to avoid having a assetField on every template. I would like them to upload all assets in ...
2
votes
0answers
664 views

Asset dynamic subfolder paths referencing entry section not available until saved

I have an asset field within a matrix block, for which uploads are restricted to a single folder. The upload location path is set to {owner.section.handle}/{owner.slug}. Using this pattern the asset ...
2
votes
0answers
124 views

Absoute urls for assets in rich text fields

Is it possible to output asset urls, specifically an image url, as absolute from a rich text field? It looks like craft is automatically changing it back to a relative url.
1
vote
1answer
31 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
0answers
74 views

Craft 3 Image Editor / Redactor - Remove?

TL;DR Can the button for "Image Editor" be removed from Redactor in Craft 3? I've looked around the Craft docs and web, but I can't find a way to remove the button that appears within the Redactor ...
1
vote
0answers
66 views

How do I correctly upload a new Asset from a temp file I generated from a service method?

Preamble Craft 3.1.26 PHP 7.2.8 on Mamp Pro 5.1.1 I browsed to my storage/reports folder and made sure in Finder than full read/write privileges are granted. What's goin on I have a module with a ...
1
vote
0answers
35 views

Asset field - saving assets with dynamic subfolder by categories not working consistently

I have two asset (image) fields in project entry type, both with the same setting and with different outputs… Anyone knows why? Thanks My fields are: intro image field gallery image field Both ...
1
vote
0answers
42 views

Image Store Issue

Dear Craft Users/Developers We have inherited a customer on our server platform using CraftCMS 2.7.4. They had their site before moving to us hosted with images using Rackspace via the CraftCMS Pro ...
1
vote
1answer
200 views

Craft 3 - Moving assets between folders causes apache connection to max out

In Craft 3, I keep running into an issue when I try to move a large amount of files (around 200) by dragging and dropping from my “Holding” folder into a “Live” folder using Craft Assets section. Both ...
1
vote
0answers
54 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 ...
1
vote
0answers
55 views

Show Images via Dropdown dynamically

I am currently working with craft. I want to create a filter with a dropdown list that will only display the images, that are related to the selected dropdown. Is that even possible? What I have: ...
1
vote
0answers
32 views

_entry.twig in sub folder, rich text editor images using relative URL and are therefore not found

This may be something obvious that I'm missing, but how can I make craft use absolute URLs for images add to rich text editor fields? Or use the {{siteUrl}} prior to the image src URL in order to fix ...
1
vote
0answers
269 views

For asset uploads, where should the 'temporary path" be created?

I just moved my Craft CMS site to production (MediaTemple DV) and I can't upload images to my asset sources. I get this error: Error uploading the file: there was a problem creating the temporary ...
1
vote
0answers
111 views

Front end asset uploads not correctly rotated

Running into an issue whereby front end asset uploads are not the correct orientation. I've spotted this mostly with user profile pics. What's the best way to start debugging this? My server has ...
1
vote
0answers
195 views

Copying asset by insertFileByLocalPath() results in fopen:()failed to open stream error

EDIT: Updated code (issue remains) I'm trying to implement functionality in a plugin that, when saving an entry with a lightswitch enabled, takes the asset at index 0 from an assetfield called ...
1
vote
0answers
33 views

Can I force extra fields to be required on asset upload

I am trying to figure out if there is a way to require additional fields be filled out while uploading an asset (mainly pdf's) in the admin control panel. I know I can add meta data fields to an ...
1
vote
0answers
526 views

Configuring assets error - Could not resolve host: s3.amazonaws.com

I'm running a craft project (ver. 2.4.2684). When I try to upload assets, the progress bar fills and the spinner continues to spin. It looks like it just stalls out and doesn't go beyond that point. ...
1
vote
0answers
112 views

Disable SVG previews for asset field?

A client of mine uploads multiple, complex SVGs (2MB and larger) to an asset field. Unfortunately, Craft CMS isn't able to automatically generate thumbnail images (with a reduced filesize, not just ...
1
vote
0answers
43 views

Listen to replacing files through CP's assets section

Admin users can replace asset files without having to deal with re-uploading/re-creating a new asset using the feature/technique described in Peter's answer here: Is it possible to replace uploaded ...
1
vote
0answers
290 views

Upload assets manually: replace existing files

Context: For a redesign and port to CraftCMS, I need to import the content from a blog hosted on another platform with a lot of content (over 500 posts and over 3000 images). Strategy: To import the ...
1
vote
0answers
74 views

Why does getUrl fail when using transforms on a translatable asset?

I have a project with the following code: {% if entry.filmPoster | length %} <img src="{{ entry.filmPoster.first().getUrl('filmPoster') }}" alt=""> {% elseif entry.locale('en_gb')....
1
vote
0answers
89 views

How may I restrict uploads to a single folder with variables within a Rich Text Field?

Craft's Asset Fields allow you to restrict uploads to a single folder—and even pass through a variable to create a dynamic path. How may I restrict uploads to a single folder with variables like this ...
1
vote
0answers
65 views

Limit control panel assets modal to a subfolder in plugin

I'm working on a control panel plugin where I want to limit users to a subfolder within a main assets folder. I have the subfolder ID, but am unable to amend the following to make use of it: {{ forms....
1
vote
0answers
136 views

Issue Updating Asset Index:S3 Product Downloads

We recently added a large file (3gb) to our S3 location, and upon updating the assets index, the file is not being recognized. The file is accessible and we have tested download directly. ...
1
vote
0answers
63 views

Asset saves in Draft but not showing up in Preview - help!

I have saved an asset to the Assets tab in Craft and successfully uploaded it into an article I'm creating. I deleted the picture it was replacing, and then uploaded it. It saves in draft, but doesn't ...
1
vote
0answers
60 views

User Group specific asset paths

I've been doing some quite involved work on a site where we want to restrict user access to certain asset paths. Following the post at Assets Folder: Images don't show up I was directed to the ...
1
vote
0answers
45 views

ID for transformed asset

Does craft save a temporary ID for an asset transform? If so, how do you access it. The ID would be used in a plugin on form submit. {% for entry in imageLibrary %} <form method="post"> ...
1
vote
0answers
111 views

Plugin access assets directly in CP

I need to develop a plugin where the user can modify his pictures (assets) on the fly. I've already done that in another PHP project and am willing to port it on craft, but I cant find any way on how ...
1
vote
0answers
61 views

asset sourcetype getLocalCopy() not working?

I need to use getLocalCopy from LocalAssetSourceType // Get asset source $source = $asset->getSource(); // Get asset source type $sourceType = $source->getSourceType(); // Get asset file $file =...
1
vote
0answers
295 views

Manually Import Assets into Database

So Im working on a site migration that had a lot of images stored in Amazon s3. I was able to get all those images into craft pretty easily by just pointing at the old S3 server. The problem seems ...
1
vote
0answers
62 views

How to flatten assets listing view (remove subfolders constraint)

Well I like in the entries listing the possibility to toggle a structure entry type between Structured and List view. I d like to do same for my assets because I got a structured assets tree with ...
1
vote
0answers
76 views

Indexing Large Files in Assets

I uploaded a couple mp4 video files via FTP. One is 3.28GB, the other is 5.53GB. I updated Asset Indexes in Settings, but they are not showing up in Assets. I checked the DB and they do not show up ...
1
vote
0answers
127 views

Amazon S3 folder path doesn't seem to affect file uploads

I'm using the amazon s3 asset source which all connects and works very well, the only trouble is that the assets field folder path is not respected. I have a bucket called 'client' and in there we ...
0
votes
0answers
4 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 ...
0
votes
0answers
6 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
26 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:...
0
votes
0answers
16 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 ...
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 ...