Skip to main content

Questions tagged [files]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
300 views

How query all folders of a volume?

I want to query a list of all folders in a specific volume in my front-end template (loggedin users only). I'll need the folderId to display all files of the selected folder. The idea is to show a ...
Maarten Heideman's user avatar
1 vote
1 answer
172 views

File Issue "A server Error Occurr" when try to upload the file

When I try to upload the file OR go to the Asset section - I have Server Error Occurr error. In console I see the error that is somehow related with ?p=admin-lime/actions/element-indexes/get-elements ...
Vladimir Shapovalov's user avatar
1 vote
1 answer
106 views

Class 'Craft\File' not found during installation

I'm installing Craft 2 locally and am getting this error message when I expect the installation screen. I've checked the write permissions, and the directory has them (inheritable permissions). ...
buck1112's user avatar
  • 400
1 vote
1 answer
40 views

How to prepend user input data to a filename uploaded through Sprout Forms

I have a contact form where users have to fill in a name field and upload a file. I want to add the name the user filled in to the beginning of the filename, eg: firstname-lastname_filename.pdf. I ...
JJefferyDev's user avatar
1 vote
1 answer
176 views

Use Service Worker in Plugin

I am currently working on a plugin that uses a service worker which gets registered on the front-end by some javascript code and the problem is that the service worker scope is restricted to /...
Jonas Geiler's user avatar
1 vote
0 answers
547 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 ...
Steven Thate's user avatar
1 vote
1 answer
315 views

Error: File to import not found or unreadable: ../../../../../lib/craftcms-sass/mixins

I have two Craft websites running locally and they both have broken css on the backend due to the error below. Every time I update it is temporarily fixed but after a few clicks or refreshes it's back ...
Mathijs's user avatar
  • 21
1 vote
1 answer
353 views

Solspace Freeform upload multiple image files

I've had a good look around and can't find any template reference to uploading multiple images with Freeform. In settings i've allowed for 5 files in 'File Count'. I'm using the following template ...
Martin's user avatar
  • 1,203
1 vote
1 answer
68 views

Prevent foreign characters in filenames?

It seems that some of our users are uploading filenames with foreign characters... Is there any way to prevent this? I'd like to keep the filenames to all English letters (plus numbers, dash & ...
Lindsey D's user avatar
  • 24k
1 vote
2 answers
490 views

How to point a static url to a file

I have a field "menu card" in my globals' section "menuCard", so I could access my file in the template with menuCard.menuCard.first().url. That is fine, but when the editor changes the menu-card file ...
Michael's user avatar
  • 137
2 votes
1 answer
207 views

Cannot get file upload/attachment with Sprout Forms working

I'm trying to add an file upload/attachment to my Sprout Form submission, but even though all the other fields are saved & the Sprout Email notification is sent - the file field remains empty - no ...
celeste.nexus's user avatar
1 vote
1 answer
115 views

Use REQUEST variable as dynamic upload location

How can I use a request variable used in an upload form like this? <form method="post" accept-charset="UTF-8" enctype="multipart/form-data"> <input type="hidden" name="action" value="entries/...
Marco's user avatar
  • 213
1 vote
1 answer
4k views

Why does asset uploading fail with the error "Uploaded file was empty"?

Recently I've noticed that file uploads through the Craft admin panel have started to fail with the response "Error uploading the file: Uploaded file was empty". This error occurs when trying to ...
FarrellScript's user avatar
2 votes
2 answers
525 views

Creating an .txt file for every entry dynamically

I'm looking to create a .txt file with table field data taken from an entry on the fly. All entries would have their own designated files. It's for video chapters with JW Player. They ask for a .vtt ...
John Macpherson's user avatar
2 votes
1 answer
50 views

Check the site for missing file links / warn user before removing used files

A client removed a lot of files in a moment of clarity, not realizing these were used in pages (thinking since they were used in those pages, they were no longer necessary in the assets system). ...
noregt's user avatar
  • 1,062
2 votes
1 answer
679 views

Custom static assets

I would like to let my static assets (JS, CSS and images file) close to my templates files. public/ templates/ css/ images/ scripts/ template.html Until now, I didn't find a clean ...
Antoine's user avatar
  • 157
2 votes
1 answer
225 views

Sprout Forms file upload

Any thoughts why a Sprout Form is not saving a form submission that contains a file. Not throwing any errors and on submission the user is returned to the form. This is a local build - I thought ...
Cole Henley's user avatar
  • 1,741
3 votes
2 answers
2k views

how to includeJsFile in head instead of body

I am using this code to include a js file, but it adds to the <body>: {% includeJsFile '/path/script.min.js' %} I need to add it to the <head> instead, how can I do?
neoDev's user avatar
  • 285
1 vote
1 answer
568 views

Getting Asset FolderId

I need to list out the image options from a specific assets folder for users to select from. Previously, I accomplished that like this: {% set folder_id = 5 %} {% for image in craft.assets.kind('...
taylor's user avatar
  • 1,128
0 votes
1 answer
507 views

500 error: uploading files (duplicate primary key)

Afternoon all - odd issue where created some new asset folders and adding new files is timing out. If I view the folder in question (on the server) I can see the file has been successfully uploaded ...
Cole Henley's user avatar
  • 1,741
4 votes
1 answer
2k views

Upload file from plugin's Controller to a non-Assets folder

I have a plugin Controller that accepts a POSTed form, including an uploaded file. If I make an Assets Source I can successfully save the file into its folder like this: $file = UploadedFile::...
Phil Gyford's user avatar
1 vote
3 answers
379 views

Retrieve Asset Filename from an entry, inside a matrix field

I must simply be blanking this morning, but for whatever reason, this has me stumped... I have a Structure section I use for the different sections of my site which sets titles for each page, etc. ...
Jeremiah's user avatar
  • 121
1 vote
1 answer
3k views

Does Craft enforce a maximum filesize for large files?

A client we're working with has a requirement to upload one large file (about 320MB) every 2–3 months. Craft has been configured with a local asset source to handle this. I'm trying to decide the ...
Stuart Whitehead's user avatar