Questions tagged [files]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
60 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 /...
1
vote
0answers
52 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
1answer
247 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 ...
1
vote
1answer
183 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 ...
1
vote
1answer
40 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 & ...
1
vote
2answers
203 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 ...
2
votes
1answer
152 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 ...
1
vote
1answer
86 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/...
1
vote
1answer
1k 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 ...
1
vote
2answers
288 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 ...
2
votes
1answer
44 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). ...
2
votes
1answer
435 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 ...
2
votes
1answer
163 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 ...
3
votes
2answers
1k 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?
1
vote
1answer
403 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('...
0
votes
1answer
447 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 ...
4
votes
1answer
990 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::...
1
vote
3answers
350 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. ...
1
vote
1answer
2k 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 ...