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

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

0
votes
0answers
4 views

Get the thumbnail of the uploaded video programmatically

I have a content type include a file field for uploading videos, what I want to do is to get the thumbnail of the uploaded video automatically from my custom module.
0
votes
0answers
8 views

Update local file paths in body type fields across site

I need to move an existing d8 site from a standalone site to part of an existing multisite setup in d8. I would like the files to be in sites/$mysite/files instead of sites/default/files. However, the ...
2
votes
1answer
44 views

How to add an extra field in file upload widget?

I know that it is possible to enable a description field in the core file upload widget for Drupal 7. However, I want to add an extra description field like the one already present. For this I've ...
0
votes
0answers
14 views

Is there a way of deleting a file field without deleting the related file entities?

I'm working on a site that started uploading files via specific Fields appearing in Content Types, but has since moved to uploading them via admin/content/file/add for consistency. I'd like to delete ...
0
votes
1answer
24 views

How do I fix File Upload After Upgrading to PHP 7

I know this question has been asked a thousand times in a thousand different ways, but none of those solutions have worked for me. Problem: I recently updated from php5 to php7. Whenever I attempt to ...
0
votes
1answer
21 views

How to add a title text input to an image field node form widget

If you have an image field widget in a Drupal node form you can automatically edit the image alt text in there, but is it also possible to add a title text field? When I install the File Entity ...
0
votes
1answer
22 views

How to make file description field as required?

I would like to set the file description as required. I tried it with this code: function mymodule_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { if ($form_id ...
0
votes
1answer
19 views

Link to content within node, from CKEditor WYSIWYG

This seems like it should be fairly simple, but I'm having trouble getting off the ground. I have a content type "Document". This content type has a field of type File, which allows for uploading PDF'...
0
votes
0answers
24 views

Programmatically submit webform with a file upload

I am developing a Drupal site with a React front-end. I have been using Webfrom with Webform REST for form submissions without any issue. I have a new webform which has a file upload field and I ...
1
vote
1answer
40 views

Unpublished file still downloadable

I have a file attached to a node via a link. The node is published but the file is unpublished. The link on the node points to the file /sites/default/files/file.txt The file is still downloadable by ...
3
votes
1answer
63 views

Delete “permanent” file when it has 0 uses

Files that are "used in 0 places" (viewable at /admin/content/files) are not being deleted automatically by cron. They also show a status of permanent. How do I allow these files to be deleted by cron,...
0
votes
2answers
53 views

How to overwrite a file upload so that the filename is always the same?

I am trying to implement a file upload form in which files are saved. I had written the following code <?php /** * @file * Contains \Drupal\avenue_product_import\Form\avenue_product_importForm....
0
votes
0answers
17 views

Should I use a 'URL', 'Path', or other form field type when the field is used to define the location that a file should be saved

I have an administrative form that allows a user to set the save location of a file. I'd imagine that valid locations would be public://foo, private://foo, and /foo/bar/foo. What is the proper form ...
0
votes
0answers
11 views

Move site with links to many assets

I am charged with migrating several pages from one Drupal site to another. There are many files that are linked on the pages (128 pdfs on one page alone) and those will need to be moved as the source ...
0
votes
0answers
5 views

Tokens not being appended to images after file_move REPLACE

Tokens are not being appended to images after file move this causes the image to be loaded from the cached image file rather than the replacement file. When uploaded an image normally in a content ...
1
vote
1answer
25 views

Get link address of a file

I have a page A that has an inline entity form that is referencing to page B, it's possible programmatically or in another way to get the link address of a file that page A is referencing to?
0
votes
1answer
41 views

Image Styles Not Generating Thumbnails/Previews

I have File Browser installed on my website. The module info can be found here: https://www.drupal.org/project/file_browser When I go to browse for pictures, there are no images. You can see what I ...
0
votes
0answers
6 views

file_move changes the image in the file system but not the image on the page or thumbnail

I'm using file_move to replace and rename a file in a forms edit page. This does change out the file in the file system and database but the thumbnail image and image on the page remain the old image. ...
-1
votes
1answer
93 views

Rest File upload octet-stream uploaded file is corrupted

I use rest to post upload file (no file_entity, but core file) following direction in https://www.drupal.org/project/drupal/issues/1927648 In the app I use FileRider to get file binary for post body. ...
2
votes
1answer
37 views

Managed File is stuck with a temporary URI, even after saving it as permanent file

I was having this problem: Files uploaded via custom configuration form are eventually lost. So, I used the solution, basically: $file->setPermanent(); $file->save(); But then, even thou $...
0
votes
1answer
20 views

How to use (reference) the uploaded file to a media(video) type?

I have read https://www.drupal.org/node/2941420 and I can upload a image file then use it in article. But I can not use it as video field after I upload a video file. My Drupal version is 8.6.0-...
1
vote
1answer
24 views

How to save file with custom form?

I try to use that script in my Drupal site https://tutorialzine.com/2013/05/mini-ajax-file-upload-form I did not use drupal form api. I used my html same with that script. I created 2 pages with ...
0
votes
1answer
24 views

How to restrict file access based on file path under private directory?

I have a list of files under sites/default/files/private/abcde/manuals/. I want to add restriction to the files based on certain logic which I can add in the code in a hook. The logic would be based ...
0
votes
1answer
43 views

Save and set an external link image programatically

I have a field that will accept an image link coming from the external source. But of course, to set that image I have to save it in Drupal first. I'm wondering how do Drupal save the image from an ...
0
votes
1answer
26 views

Links to files breaking

I just wanted to see if anyone could offer some thoughts or opinions on an issue we are having. We are running Drupal 8 multisite via Aegir. We have a production environment and an identical testing ...
0
votes
0answers
38 views

How to change from Token based file download to normal path file download

I am trying to attach the document(pdf) in CKEditor using "Add Media" option. The problem is that it is making the path to download the file like this "https://domain/file/fid/download?token=xxx" ...
4
votes
1answer
409 views

How do I set permissions for a subdirectory that Drupal creates when uploading a file?

I'm using Drupal 8 and the Flysystem module to configure remote file storage via SFTP. My question probably applies in general, though. When a file is uploaded, and the file directory setting has a ...
0
votes
1answer
10 views

500 error on one page in entire site only showing error “You are here” instead of administration content

this error seems to only affect one page in on the website, and nowhere else. Here is what it looks like: The watchdog reports do not show the issue, and I believe it to be a permission error or ...
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, ...
0
votes
1answer
20 views

Features 8.x-3.7 not writable on Window's Ubuntu

8x-3.7 features, most stable version, but I am having trouble writing to custom module on the UI. My structure is as follow: -modules/ contrib/ features/ custom/ news_blogs/ ...
1
vote
0answers
36 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
19 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
118 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
37 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, ...
1
vote
1answer
31 views

How to restrict users of other roles from seeing the site administrator details?

I have created a role called "Site Admin" and created a user with that role. When i log in with that username. "People" menu is showing in toolbar only when we give "adminster user" permissions to ...
0
votes
0answers
13 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
175 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
4answers
631 views

How to set up permissions for the private files directory?

I'm trying to set up the private files directory and I'm getting the following error. The backup file could not be saved to 'private://backup_migrate/' because the directory could not be created ...
0
votes
0answers
39 views

Drupal 7 AJAX not working on entire site

Images upload, Views Submit (Ex. Global: Text area, edit fields in Views) are not working in my Drupal 7 website. Here is the access log I found from Apache; 127.0.0.1 - - [19/Jul/2018:12:46:51 +...
0
votes
0answers
17 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
14 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
144 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
65 views

File upload error. Could not

I have Drupal 8.4 running on Windows Server 2016, and when trying to use an upload field on a content type I get this error The file phpC128.tmp could not be saved. An unknown error has occurred. ...
0
votes
1answer
42 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
78 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
35 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
24 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 ...