Questions tagged [files]
Use it to generally reference to those files used on websites which could be video, images, pdfs, etc.
2,485 questions
0
votes
0
answers
36
views
Image path changed after adding translation or clone
I am facing the following behavior.
Pattern 1
Create English content
Upload an image to Thumbnail field (this is a content field)
Add a paragraph and upload an image (paragraph field)
Add Japanese ...
0
votes
1
answer
55
views
Configured Image style options not showing in CKEditor when uploading image (not media)
In CKEditor I am using the image field (not media) to upload an image. I would like to set the size for that image by selecting one of the image styles that are configured in Drupal, but only the ...
0
votes
0
answers
33
views
Change File field content on custom validator error (programaticaly)
On a Drupal 11 we have a content type that is filled step by step by several users (a kind of workflow).
This content has a custom #validate function.
At the content creation a user sets some ...
2
votes
0
answers
37
views
Prevent upload file with same name and extension
Could some one help me to prevent uploading file with the same name and extension. By default Drupal add _0,_1.._n to the files with same name and extension. I am using filehash module to prevent ...
0
votes
0
answers
43
views
How to upload multiple files to a private folder in webform
I created a webform with a File upload field. For the file settings, I set 'Private files' as the 'File upload destination' and allowed a maximum of 3 files to be uploaded, with the option to remove ...
0
votes
1
answer
249
views
How can I have dynamic file upload locations based on e.g. media category?
For my media type "video" I can define the upload file location such as "sites/default/files/video/" at /admin/structure/media/manage/video/fields/media.video....
0
votes
0
answers
112
views
Webforms file upload automatic saving to /tmp (_sid_) causes vulnerability?
We've recently encountered a potential security issue with Webforms file upload field automatically saving any selected file to /tmp (/_sid_), even when the filesystem is private.
The current file ...
0
votes
0
answers
71
views
Add field file for upload inside a custom field
Drupal 9.5.11
I have a Timeline component that uses three fields:
field_title
field_body
field_timeline
Field_timeline is a custom field with:
TimelineDefaultFormatter.php
Timeline.php
...
1
vote
1
answer
147
views
Avoid serving unused core files
I analyzed my Drupal website using Chrome's Code Coverage feature. I noticed that there are a lot of core files loaded (CSS and JS) which aren't used at all, for example:
Resource
Unused
/core/modules/...
0
votes
1
answer
79
views
Cannot find file input
Im new here and currently building my first Drupal website. Im having trouble creating a webform because i cant find the file input option to include in the form. When i googled it, i found that the ...
0
votes
1
answer
60
views
Creating a file type of epub in commerce
I want to give customers the option of downloading an epub file or a pdf in Drupal Commerce 2. Drupal 10.
In admin/structure/media types/document/manage fields I added the document file type epub.
...
0
votes
1
answer
856
views
Is there an API to read file content?
Most references seem to read files using PHP functions like file_get_contents(), fgets(), fread(), or readfile().
Is there is any Drupal API that allows to read uploaded files independent of ...
0
votes
0
answers
68
views
Entity upload endpoint (POST) API security
Although Drupal provides default security features, I still have a doubt related to the security of uploading a file using the file entity upload API URL.
If I have set the allowed file extension and ...
0
votes
0
answers
302
views
File Does Not Exist - Drupal Migrate module
I am using the Migrate Drupal UI module to upgrade a simple Drupal 7 site to Drupal 9 using the web browser upgrade form.
I am having an issue where when the upgrade runs it says the files do not ...
1
vote
0
answers
736
views
Why is CloudFlare blocking file uploads?
I have a simple form where people raise IT helpdesk requests (oh, the irony...) and this creates a case in CiviCRM. It's an unsophisticted but cheap helpdesk system for the few requests we get.
A ...
-3
votes
2
answers
297
views
settings.php permission denied on Mac
During a project installation always fails to install correctly.
Let me clarify this is how it should work: Drupal changes the chmod of settings.php to 777 and then applies changes for the drupal ...
0
votes
0
answers
166
views
Public Access to Private Files
I have a content type that allows one or more file attachments and these are set as Private so that access to them can be controlled. A small percentage of these files I also want to be publicly ...
1
vote
1
answer
952
views
GET /sites/default/files/js/js_xxxxxx.js - No such file or directory
This is my first post, I just started to learn and use Drupal, and I wish to install a fresh new site on my local Windows machine using composer. The issue is that it has a file not found error from ...
0
votes
0
answers
237
views
how to add the "alt" attribute to a "managed_file" type image field
I have a custom form in drupal 9 where I am creating a managed_file type field to upload an image:
$form['footer']['logo'] = array(
'#title' => 'Logo',
'#type' => 'managed_file',
'#...
0
votes
0
answers
320
views
Temporary file issue when creating a file from an external script
I would like to create a file and write some data to it using a PHP CLI script. The script will bootstrap Drupal and then use either the file_system or file.repository services to perform the task.
...
-2
votes
1
answer
358
views
Deleting a File from Website [closed]
I host my municipality's website (lionsbay.ca) through Drupal. On this
website, residents can find council minutes and agendas. Upon request of a
resident, she would like her information removed from ...
1
vote
0
answers
388
views
Running a hook after node save, or another way to get the file name attached to a node
We've a D9 site with a custom module which generates and saves CSS code. It takes the name of the file attached to a node, and generates CSS to set it as the node's background.
Initially, I tried ...
0
votes
1
answer
839
views
How to upload .webp to Image field?
https://www.drupal.org/project/imagewebp lets you upload a regular jpg/png which converts it into webp, but how to upload already a file that is in webp?
Adding it as one of allowed extensions in the ...
1
vote
0
answers
91
views
fclose only creates file at script end when running drush command [closed]
I'm really struggling with Drupal php memory/file/cache management. I've tried a lot of different ways to avoid memory errors (php 8.1) when writing a multi-megabyte file out. My observation is even ...
0
votes
0
answers
548
views
How can I send a multipart/post-data POST request via a resource controller?
By trying to create a custom REST API through a resource controller via a custom module in Drupal 9, I would like to be able to send my data from a multipart/form-data Content-Type in order to pass ...