Questions tagged [files]

Use it to generally reference to those files used on websites which could be video, images, pdfs, etc.

Filter by
Sorted by
Tagged with
2
votes
1answer
31 views

Should scripts/*.sh files be executable?

Drupal 7's recommended file permissions don't allow it's /scripts/*.sh files to execute. Should any server user have the ability to run those?
0
votes
1answer
23 views

ExtensionDiscovery::scanDirectory() takes too long

I have been debugging a bit an issue on our platform and I notice that our scanDirectory takes, from time to time, way to long, more than 100seconds. I have been looking at the default.settings.php ...
1
vote
1answer
17 views

File Field related issue / How to hide file size information?

I used CDN option while creating my sub-theme. I find less and sass things pretty confusing since I am someone who haven't mastered the css yet. What I have found out so far is: I can edit some ...
1
vote
1answer
19 views

How can I link the file name to the file?

I created a content type with a "file" field type. This to upload a pdf file. Now I want to create a link to open that specific file, in my twig. If I do this : <div>{{content....
-2
votes
0answers
19 views

Use of undefined constant FILE_CREATE_DIRECTORY in File(Field) Paths module

In Drupal 9, using the last dev version of FileField Paths, whenever I upload a new file, after saving the form I get the following warnings: Warning: Use of undefined constant FILE_CREATE_DIRECTORY -...
0
votes
0answers
75 views

How to create a 'button' which is linked to a Media Document with custom Link text?

I am trying to create the ability for a content editor to add a button to an entity which links to a Media Document. Essentially the requirements are that we can upload a file and that file is ...
0
votes
1answer
45 views

Private filesystem does fire 403 on every role and file

Like the title might expect I am not able to view any file that i am delivering through the private file system. Only if I bypass the access check via role settings. I tested it a minute ago with a ...
0
votes
0answers
41 views

Private files need to be switchable to public

We have private nodes. Nodes that are just visible for logged in users. These nodes are setup to use a private filesystem. These "private" nodes can also become public if an article is moved ...
0
votes
0answers
16 views

I cannot upload XML files through managed_file

When i try to upload a .blm file in the admin upload page on /file/add, the file is uploaded to the temporary folder, but no file entity is created. Instead, I get this error. Drupal\Component\Plugin\...
0
votes
0answers
17 views

How to get IMCE to view just one S3 bucket folder created by IMCE

I have 700 training courses. I want to to be able to go to a drupal page and access that courses files using only the IMCE module. I like the ability to create folders and download and upload files. I ...
1
vote
1answer
43 views

How do I track a publicly downloaded file?

I am creating a custom module to track the file download time and user id with a file link or path. I have tried multiple modules but the download the file time tracking option is not available. How I ...
0
votes
1answer
26 views

Why there is not loadData() method in FileSystem?

To use the private:// scheme of Drupal 8 I had to : Create a folder outside the docroot folder Implement a $settings['file_private_path'] = '../private-files'; to designate this folder Make sure ...
1
vote
3answers
91 views

How to clear image (or file) field data for specific node programmatically?

I need to clear/remove image (or file) field from specific node. I have before: I want to get after code execution for the field: What code should I use to properly clear image (file) field data?
0
votes
0answers
33 views

How can I download protected files using the REST API?

How can we download the protected files using the REST API by using the BasicAuth? I've tried below code with BasicAuth var settings = { "url": "domain/system/files/guides/docs.pdf&...
1
vote
1answer
33 views

How to render text including video embed field

I have a formatted text field, and am using the video_embed module to allow users to embed video into that field, using the video_embed_wysiwyg submodule. I am then trying to render the field in a ...
0
votes
0answers
15 views

Drupal 7 creating a form field to upload multiple images

I'm creating a from in a custom Drupal 7 module with a field for multiple images, which isn't working as expected. As an experiment, I added a custom field to the user acct settings of type image with ...
0
votes
0answers
12 views

Get upload date of a file

On my Drupal project, for a local cycling club, on the pages that show the different routes we'll be doing there is a link to a gpx file that contains the route details. Since routes change often ...
0
votes
0answers
33 views

How to use parent paragraph or field name in template_preprocess_file_link function?

We created custom theme suggestion for fields links using this code function THEME_theme_suggestions_file_link_alter(array &$suggestions, array $variables) { $route = \Drupal::request()->...
0
votes
0answers
29 views

Upload External File to Drupal File System

Situation I would like to be able to upload files programmatically from an external source to the drupal file system. I was thinking of making a RESTful API that allows me to save external files into ...
0
votes
1answer
49 views

With managed file, dynamically set fileName and #upload_location

In a form I want to bulk upload jpgs renaming them using exif date information and dynamically setting the #upload_location according to the value of a textfield in the same form. I have no problem ...
0
votes
1answer
33 views

Add upload/processing status bar/throbber

I am new to Drupal/web development and I have been trying to create a module to add files upload menu. Once the files are uploaded, they undergo processing and a message is displayed upon completion ...
0
votes
0answers
17 views

Images randomly not found

I have an issue on Drupal 8 with images randomly not found. I am actually not sure if the issue comes directly from Drupal. I am developing for my organisation a website currently quite simple with ...
0
votes
2answers
36 views

File size on View

Is there a way to display the file's size next to it in a View? This is for a File field in Drupal 8. I tried the advice (for D7) here, but I received this error. The handler for this item is broken ...
1
vote
2answers
40 views

Permit only one role to download files

I'm trying to set up a new D8 site. It needs to include some "subscriber only" type functionality. There is one content type which is little more than a title, a file, and one extra field ...
0
votes
1answer
13 views

How would you convert a link to a media item to the file URL in a menu?

I would like to be able to link to media in a Drupal menu and have the link converted to a file url. Is this possible?
0
votes
0answers
31 views

system_retrieve_file() not returning fid

when I'm calling system_retrieve_file like: $thumbnail = system_retrieve_file($thumbnail_url, NULL, TRUE, FileSystemInterface::EXISTS_REPLACE); It downloads the image into the file system, but when ...
0
votes
1answer
22 views

Create nodes from a JSON file uploaded in a form by an user

I've got this form: $form['import_json'] = [ '#type' => 'file', '#description' => $this->t('Allowed extensions: json'), '#title' => $this->t('Import your JSON\'s ...
0
votes
0answers
16 views

I Can't alter the file upload with #upload_validators

I am writing because I am trying to alter a Drupal 7 field called Uploaded Files (field_uploaded_files) on a node type called Documents (documents). I need to check files uploaded by their magic bits....
4
votes
2answers
44 views

Upload an image to filesystem, rename it and set it as Profile Picture for current user

I have the external link of an image where I am trying to: Upload the image to filesystem. Rename the image. Set the owner of the image to current user. Set the image as Profile Picture for current ...
1
vote
0answers
20 views

File (Field) Path settings to rename multiple images with their alt or title

The module File (Field) Path allows me quite nice to rename a single image file with its "alt" or "title". But if allow the image field to accept multiple downloads, I cannot get the individual alt/...
0
votes
1answer
37 views

How can I restrict access to a static HTML page served from a subfolder of my site to authenticated users only?

I have a Drupal 8 site that has all roles and permissions necessary for authenticated users. One of the new requirements is to serve a static microsite (like a campaign site, totally different design ...
0
votes
0answers
24 views

Access denied on creating field 'status'

Uploading image via API http://drupal.local/entity/file?_format=hal_json API responding error Access denied on creating field 'status' when adding status field. I am using that API with credential of ...
0
votes
0answers
19 views

Why is the Downloading file size unknown despite Content-Length headers set with file size in bytes?

During Downloading files the size is unknown "0B" despite having set the "Content-Length" headers with the bytes (see $http_headers below) Content-Type (String, 15 characters ) application/zip ...
1
vote
0answers
65 views

migration using csv and yml for multivalued image field

some problem with sub-process plugin. Here are my yml and csv files. uuid: c0948690-b539-421e-b306-6a49d14afd64 langcode: en status: true dependencies: { } id: migration_multivalues class: null ...
1
vote
1answer
172 views

Folder permission errors on public:// after upgrade to 8.8.5

I'm new to this community, and asking for help because I'm stuck on this problem, and cannot go past. I've also tried asking on StackOverflow, but with no luck so far. My current setup: Drupal 8.8.5 ...
0
votes
1answer
20 views

How do I add a file upload button?

I have a view and have styled the view with a Twig template. The view show nodes whose content type is Programs. I would like to add a Upload button in the view so that admininistrator users can add ...
0
votes
1answer
28 views

How to make a private file visible after changing file URI?

My task is automatically convert image files to pdf, when they are attached to a certain field. So the field accepts both the images and pdf files, but converts uploaded images to pdf. The field saves ...
0
votes
0answers
30 views

How do I load a file as entity knowing its full path?

I want to replace a file entity while uploading it via hook_entity_insert(). I upload a file using its full path, for example /var/www/web/sites/default/files/test.png I convert it to some another ...
0
votes
1answer
33 views

Where can I set the following HTML attribute to my custom field?

I'm developing a custom module with an image field. Where can I set the following HTML attribute to my custom field? <input type=file accept="image/*" capture=environment> I ...
0
votes
0answers
22 views

File field edit form change display style attachments

I need help. I would like change display attachments when edit entity. Default Drupal display attachments in table but I need change this to eg. unordered list or anything else - how to? I found many ...
-2
votes
1answer
30 views

Is it possible to bypass the local filesystem completely using an alternative filesystem?

I'm using a cloud hosting provider to host a Drupal site (7 moving to 8) with a huge amount of static file assets. The host charges a lot for file space. Is there a way to bypass the local filesystem ...
-2
votes
1answer
26 views

Unicode Library [closed]

I am currently having "Requirements problem" with Drupal. When I 'Verify requirements' at the start, I get an issue of not being able to continue. Unicode library Multibyte string input ...
0
votes
2answers
40 views

How do I load a Media entity from a File entity?

I have a File entity loaded programmatically. I want to load a Media entity from it. Is there a way to achieve this?
0
votes
0answers
23 views

How to upload image to media library? (No upload field)

I'm missing something in media_library. When I click "Add media" in the media library (/media/add/image) there's no browse/upload field. All of the other media types have an upload field. This ...
0
votes
1answer
20 views

In node add, how to upload file using image from clipboard

How can I paste image from clipboard and save into image_field ?
0
votes
0answers
132 views

How to set different root folder access for different roles in elFinder

I'm using drupal 7.69 and elFinder 2.1.46. A private page is showing elFinder browsing window with 2 root folders root1 |-dir1 |-dir2 root2 |-dir3 |-dir4 I am trying to setup 2 roles: ...
0
votes
0answers
43 views

What exactly is affected by “Default download method” setting?

At /admin/config/media/file-system is option Default download method (public or private files) which sets "the preferred download method". I am not sure what exactly is affected by this setting? ...
0
votes
0answers
41 views

Unable to upload a file

I have configured a file field to be encrypted with a RSA profile (via File Encrypt module). Everything works fine on the DEV environment (Windows) but when I deploy on the TEST environment (Linux), I ...
0
votes
1answer
14 views

Private files get Access Denied for any non-admin role but only on server

Very odd problem. I have a bundle where a user uploads a file to a private file field. When viewing the bundle; they see the file listed and can see it is linked to the file; but when clicking the ...
0
votes
0answers
20 views

How can i move public file directories files & folders to the public file directory in drupal 8? [duplicate]

I want to change the file directory path to private from public but i don't know how to move the previously uploaded files to the private directory.

1
2 3 4 5
48