Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

-2
votes
1answer
30 views

What is the welcome page file that we inspect? [on hold]

I want to edit the html of the Front page of drupal 7. However, i don't know which file is it ? What is the name of the front page/ welcome page file that when we inspect we get it. I previously ...
-2
votes
0answers
19 views

Adding PDF Reader to content page [closed]

I'm trying to use https://www.drupal.org/project/pdf on my Drupal 7.59 page. I installed all the required dependencies but I'm not able to embed .pdf-files using a proper pdf reader when using the ...
0
votes
0answers
15 views

Why is my user getting logged out before reaching hook_file_download()

I'm having problems where my logged-in users are trying to access a file (in private file area) but when they get to the hook_file_download() function of my module, they are coming through as user 0, ...
1
vote
0answers
15 views

Use Filename for File entity Page and Window title

Drupal 8 file entity full display mode apparently uses the word 'File' for both page title and window title. Yuck. I've reviewed the various answers on this question, but I'm not seeing a definitive ...
0
votes
0answers
17 views

User download history

I'd like to use Group (NOT Organic Group) module in a Drupal8 setup, hoping to create a permission system so that a certain group of users can access and download pdf (residing in private folder) Is ...
1
vote
0answers
32 views

Google invisible recaptcha doesn't work with form file fields

I have a form in my drupal project which has a managed_file field. It worked perfectly until I added invisible recaptcha for the forms. The file is getting uploaded but when I submit the form the ...
0
votes
2answers
29 views

How can I get the uploaded file path of a contact form in drupal 8

I'm using the hook_mail_alter() to create a custom email for contact forms. I was able to get the fields labels and values and use a twig template to send the email. Most of it is working just fine, ...
0
votes
0answers
11 views

Sending .ics attachment using drupal_mail() function [duplicate]

I am using Drupal 7, with the Mimemail and HTML mail modules enabled. I have some PHP code running on the background of a template file, and I am trying to send an email with a file of extension .ics ...
0
votes
1answer
36 views

How to open file in new tab instead of download when submitting form?

The code below downloads the current file, I need it to open the file in a new tab, what needs to be added in order to do so? public function submitForm(array &$form, FormStateInterface $...
0
votes
0answers
15 views

Not seeing file upload destination radios for image field in custom blocks. Where is the fault?

Scratching my head with this. I am working with a custom block and have added an image field. However the Upload destination radios are not present and this results in a file storage error. ' Illegal ...
0
votes
1answer
13 views

Site is redirecting to old domain on button submission, files are linking to old domain [closed]

I have a D7 site at www.example.com, an old one, not updated since 2012 (Drupal version 7.34). I made a clone copy with separate clone database under dev.example.com All files like CSS are still ...
0
votes
0answers
10 views

Form field API download field?

I have a form where user can upload a CSV file to import some data, the thing I want to do is add a field where the user can download an example of csv to create is own. The form I create is made ...
5
votes
3answers
81 views

How to make existing public files private?

Let's say I have a node type "Article" which has a field "File" which is set to handle public files. A lot of articles and files get added. Now the specs suddenly change and the "Article" will move ...
0
votes
0answers
18 views

I cannot delete a file field from node

D7 content type with file field. On edit page, displays attachment(s) with Remove button, but cannot remove. Get blue "spinner" for a few seconds. Also issue with upload of file field. Upload action ...
0
votes
0answers
27 views

Referring two file systems in a single site

I have production and staging environment that use the same file system (Amazon S3). I need to change the user profile picture saving path of my staging environment to local file system and other ...
0
votes
1answer
28 views

Adding a file download link to a node

I have a content type recipe and for each recipe type content I want to add a link which can download the recipe for the user. How can this be done in Drupal 8.5.2? I'm not sure if I should provide ...
0
votes
0answers
71 views

Maintain Folder Structure When Uploading Files

since weeks I got the following Problem: I need to upload some files to my Server via a file field. I used several extern libraries like DropzoneJS and Plupload and also the build in core file field ...
1
vote
1answer
33 views

How do I manually configure the Link module?

I would like to be able to add the file:// protocol to the list of filter_protocols so that we can add links to shared company files on a mapped drive from within our intranet website, but I'm not ...
1
vote
1answer
21 views

Nodes display links to shared document(s)

Summary Nodes display links to shared document(s) Example PDFs to upload only once before I create the workshops: Booking Form Primary School Booking Form Secondary Schoool Risk Assessment for ...
4
votes
1answer
435 views

Load a file entity by URI

Is there a way to load a file by URI in Drupal 8? In Drupal 7 it is possible by the next example: $uri = 'public://file.xyz'; // Take a look at: file.inc::file_load_multiple $files = ...
0
votes
0answers
23 views

Updated Manage Display in File Generic

I am using the VarBase distro, Drupal 8.5.3, on an Ubuntu server 16.04, PHP 7.1 When I select Generic File I get this result: I want to know where I can modify that, to leave only a link. That says:...
0
votes
0answers
16 views

Content types. Manage Fields. Add button right after specific text (plain) field

Drupal version is 8.4 I created a custom content type with set of different fields. I need to add button or link right after specific field (field type = text(plain)). So i can click on that button/...
0
votes
0answers
8 views

Migrate + import image from xml

For a test, I tried to import an image from a XML file. This xml is already configured in another migration, and I can create medias from this source. But, to import images I get this error: ...
0
votes
0answers
20 views

Migrate + Import multiple images from each row source

we can see many posts for import files with migrate. All these posts explain how to import an unique image/file by row. In my source, I have several images on each row, e.g.: #title,images,...
0
votes
0answers
8 views

Where are file_managed files stored in the server?

I have a Drupal7 site an I have to extract all uploaded files. I see that in the database the urls are stored in file_managed table. I have been searching inside the Drupal files to find the files, ...
2
votes
1answer
60 views

How do you upload an image via jsonapi?

The documentation is vague: https://www.drupal.org/docs/8/modules/json-api/working-with-files-post I am trying to upload an image following the sample code given for uploading a "document" on above ...
0
votes
0answers
15 views

Web Forms doesn't activate in time for PDF download [duplicate]

Hello I'm working with a broken web form, the issues is that the current form would only pop up after loading the PDF in a different window tab. The form is completely ignored after clicking the PDF ...
0
votes
1answer
37 views

Migrate Alt and Title text from a D6 image file field to D8

I'm trying to migrate a multi-value D6 image field to D8. I've already migrated the files with d6_file and it worked. When I do the node migration with the image field works and I get all the values ...
1
vote
1answer
46 views

How to allow any file extension (or use a blacklist instead of a whitelist) for file fields in Drupal 8?

For a file field, it’s required to enter file extensions in "Allowed file extensions". Is there a way to allow any file extension? Or a way to switch from a whitelist to a blacklist? What I found ...
0
votes
0answers
21 views

Populate ajax populated field selection after file upload

I have a a ajax populated category field based on the country dropdown field. The selection for reset after the file upload. Is there any way to set the selection after file upload. $form['send_cv']...
1
vote
1answer
21 views

How to Add Existing File to file_managed. File is Blank

I have manually added some files to the Private Files directory on my Drupal 7 site and wish to add them to the file_managed table in the database. This is what I have attempted: Load the existing ...
0
votes
1answer
22 views

Access image/file with REST and Basic Authentication

I'm trying to access images/files in Drupal 8 through REST. They are only accessible for authorized users. I'm able to get the URL to the files, but when I try to load them using Basic Authentication, ...
0
votes
0answers
37 views

How to replace vendor to httpd.private/vendor?

Normally the vendor dir is placed outside the webdir. The structure on my hostingprovider is: --httpd.www - core - modules - themes - ect ... --httpd.private - vendor How to fix this issue?...
2
votes
2answers
663 views

Protect drupal code injection from url

Recently my drupal site is hacked. When i see website log from drupal admin panel someone trying to inject code from url. I searched my website(drupal) directory lots of code in page appended and new ...
0
votes
1answer
44 views

View of attached files to a node

I use D8 Editor File upload to add files to a node. But i want an overall view from all the files in that node, but only in that node. I can create a view for all the files but i can't filter on the ...
1
vote
0answers
33 views

Private files works on one site but not another

I have two sites on the same machine - demo and dev. They are served from their respective home directories. I've set up private files on both. All the settings seem to be exactly the same. However, ...
0
votes
0answers
55 views

Automatically overwrite existing file, and keep same filename when uploading new.

I am building a site with D8, where I have a content type 'user' where among other fields, I have two 'file' fields where users will be uploading their CVs (one for english, one for greek language). ...
0
votes
0answers
23 views

FileNotFoundException for existing file?

I'm using the below EventSubscriber to redirect a media entity's URL to it's file's URL unless that file is one of several file types, in which case I want to force a download. I've gotten it to ...
1
vote
1answer
46 views

How to fire a Rule when an image is removed from Image field with unlimited values?

Working with Drupal 7.58 and File Entity 2.19 and Rules 2.10 First I needed to fire a rule when saving a new file and I found a solution (here). Now I would like to fire a rule when an user removes ...
0
votes
2answers
22 views

Reference a filename in form validation for an image

I am new to Drupal and am making a module to alter a content type. I have a content type that allows a user to submit an email and an image and I want to change the filename of the image to the email ...
0
votes
0answers
24 views

How to write a file in themes folder?

How can I write data to file in themes folders? I am getting the following error. Directory permissions are drwxrwxr--. temporary://fileOFwrpn could not be moved/copied because the destination ...
0
votes
0answers
21 views

Entity Reference Error when uploading profile picture

We are getting the following error when uploading a profile picture as an authenticated user. Drupal Version is 8.5.1. Its working fine for admin users. We don't have any permission modules installed ...
-1
votes
1answer
52 views

How do I display file and description field when multiple files are uploaded in a view?

I am using Field Collection module to display title and files all together. When I upload multiple files, the description field for each file is enabled, but it is replacing the uploaded filename. ...
0
votes
0answers
63 views

Access denied on image styles images with private file system

Image upload is private. Images are being accessed through /system/files/ path. But on accessing the private images with image styles in /system/files/styles/ path I'm getting access denied. I have ...
0
votes
2answers
24 views

Link to download pdf from webform email

I have created a webform, after the submession the customer is sent the registration confirmation e-mail. How do I include in this email a link to download a pdf ?
0
votes
0answers
37 views

How to control (rename) filename of uploaded file

I am building a site for my school. Teachers will be able to upload their CVs. Their files will be PDFs and I need to have them in two languages (English and Greek). So I have a File field type ...
0
votes
1answer
186 views

The directory tmp does not exist and could not be created

I keep getting this error since updating to Drupal 7.5.8 and cannot get rid of it regardless of trying all I know. Even adding it / copying-pasting the previous tmp dir or changing the tmp file name (...
1
vote
1answer
34 views

How to add files using rules module?

This question follows Override webform module submit Based on this answer, I used the rules module to create a node after webform submissions. My webform contains an <input type="file" /> for ...
2
votes
2answers
104 views

The path admin/content/files is missing in Drupal 8.5

I have installed Drupal 8.5 and today I realised that the tab admin/content/files is missing. Thanks to my backups I realized that this tab link is already missing since the 14th of March. Prior to ...
0
votes
0answers
28 views

7 Unable to use file_usage_add when adding new content (node id doesn't yet exist)

I have a custom widget with custom field definitions. I am using hook_widget_form to create my fields, and I am attached a custom validation function using the #element_validate property on a fieldset ...