Stack Exchange Network

Stack Exchange network consists of 175 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

Questions tagged [files]

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

0
votes
1answer
483 views

Module webform2pdf modify template

I have sereval webforms et each webform send a mail with a pdf. I would like to do a template for each webform. I use webform2pdf in Drupal 7 to send pdf by email. How can i do that ?
2
votes
2answers
502 views

How can I update file attachment and keep filename?

I understand changes of file attaching in D7, but problem is, if I delete and re-upload changed file, the deleted file is still on server and re-uploaded filename gets changed. If I understand ...
2
votes
3answers
3k views

How do I create a file download URL?

The function file_entity_download_uri() seems to no longer exist in Drupal 8.4, and I need to build a download URL for a file. I would not like to directly expose the file location.
0
votes
1answer
582 views

Field formatter only displays file name not link to file

I installed Drupal 8.3.5, no extra plugins or themes. I have added in the "base page" (structure/type) a field (file_in) to upload files. If I add a new page (node/add/page) and also load a file in ...
0
votes
0answers
12 views

Form with manged_file filed is not submitted?

I have a form in my drupal module. in my form, I have used manged_file field. form name is "difference_form" and I have created two functions. one is "function diffence_form" for form definitions. ...
-2
votes
0answers
15 views

How to restrict Brightcove videos from uploading locally?

When we try to browse and upload brightcove videos, it is uploading both locally and in brightcove, but I want it uploads only in brightcove not locally.
0
votes
1answer
341 views

How to file_save_data with utf encoding?

file_save_data is saving files with ANSI encoding. I want utf8. How can I specify encoding?
0
votes
2answers
479 views

Limit the number of uploads per image field depending of role

I need a hook (or something similar) where I can set the number of image uploads depending of the role of the user. In the settings of the field there is no way to set the maximum number of values ...
0
votes
1answer
338 views

My ajax is altering form action/URL thus makes me impossible to read the $tid from it

I am using WEBFORMS which have as the topic taxonomy terms saved as hidden fields. Unfortunate, after attaching files using Upload button this terms are lost ('No category'), as ajax is altering the ...
0
votes
1answer
524 views

How do I create a file download popup form?

I am new to drupal, and I want to create a popup form with with form fields for name and email, and a buttom to download and to close the popup. When users click on the download link, the popup form ...
0
votes
1answer
18 views

D8 | Custom Form managed_file field limit number of upload files

I have a custom form in D8. Form has managed_file field. I am facing challenge regarding the limit of number of files upload to this field. I have to make this managed_file field to upload only 3 ...
0
votes
1answer
680 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 $...
3
votes
2answers
3k views

How to do file downloading in a controller function?

I asked the question about downloading of files upon submitting a form. Now I want to clarify how to do it in the case of controller function. That is, some controller is called and its function is ...
0
votes
0answers
22 views

file_exists with 'replace' or 'use existing' not working when a variable is passed

Can somebody point out the fault in this snippet for downloading a file entity. I am trying to replace or use existing file dynamically using migrate_plus. When I give a variable it doesn't seems to ...
1
vote
2answers
284 views

How to get the File Description on a custom field formatter?

Greetings to all of you. This is my first question posted around here, so any suggestions are welcome on improving how to better formulate questions. Into the matter. I have the following code in a ...
0
votes
2answers
106 views

Add Field as Entity in Group Module

The group module is an alternative to the og module. The og module allows you to assign permissions to fields per group. I would like to be able to do the same thing with the group module. It ...
-1
votes
1answer
372 views

How do I implement Download Count?

I am trying to sort my view of documents by "most downloaded". I see that there are only a few modules, Download_Count being one. There is no documentation on how to implement this. I have installed ...
0
votes
2answers
574 views

How do I migrate the file attachments field from a content type?

My Drupal 6 site has different content types, and there is a File Attachments field added to the content types. While migrating to Drupal 8.1, this field is not getting migrated, but the attached file ...
-3
votes
1answer
24 views

change of Public file system path [closed]

how can i change Public file system path in drupal 8 ? And can you tell more about how to increase the storage of database?
0
votes
0answers
7 views

Is it possible to use the path alias token as file path with filefield_paths module?

I'd like to use the path alias in order to create the folder structure of the uploaded file. First of all I could not find the correct token in the list and after a while decided to create my own ...
0
votes
0answers
11 views

Acess denied to files set as permanent in tmp folder

I made a module that saves custom files in the tmp folder when users add a product to the cart, and move the file to private folder when the order is submitted. If I set the file status to 0, users ...
0
votes
2answers
342 views

Can I use plupload to load multiple image files into a single image field

I have an image file field on my Drupal 7 site that allows users to add 4 images. I would like to give my users the ability to load all 4 images at once. I have discovered the plupload module and ...
1
vote
4answers
507 views

Add another item by multivalued fields directly from node (or entity) view page

I have a file field which can have unlimited number of values. I am using File Entity module. As default, if users want to add more files, they must edit the node. I'm looking for a solution to give ...
0
votes
0answers
9 views

Files not being saved in sites/default/files

I am having a problem when I upload a file in Drupal 7 through content/files and click on add file. The URL path for the file is always saved as files/ instead of sites/default/files/. In ...
-2
votes
1answer
21 views

Encrypt images before node saving and decrypt them when a node is viewed

I am searching for a way to encrypt images before saving them on server (private folder) and decrypt it when node is rendered for roles that have views permissions. I found the Encrypted Files module,...
2
votes
1answer
540 views

how to bypass video conversion for mp4 files?

I am using the Video module on my site, and would like a would like to bypass video conversion and a user uploads a file in MP4 format. Is there any way that the bypass video conversion? The reason ...
1
vote
1answer
849 views

How do I delete files attached with media entity in drupal 8.4.2?

Background: drupal 8.4.2 custom media solution Issue I can not delete files permanently which created as media entity. Reproduce Created an image media entity. /admin/content/files claims status ...
0
votes
0answers
23 views

Drupal 8 uploaded should be stored in certain s3 bucket

Currently, I'm facing an issue while uploading a file. I'm fetching the file tid with hook_entity_presave: $file_tid = $entity->get('field_photos_photos') ->getValue()[0]['target_id']; if(!...
0
votes
1answer
552 views

Delete old files from server when content is updated in Drupal7

When a node is updated by replacing a new file upload, old files exist on the server maintaining versions.I want delete old files from server when content is updated in Drupal7
0
votes
1answer
537 views

How to submit form on selecting image in file select widget?

I am using Drupal Form API to upload profile image for user. I found two file upload widgets in FORM API: '#type' => 'managed_file' & '#type' => 'file' managed_file requires first ...
0
votes
1answer
917 views

Why is JW Player not working in custom Content Type?

I am having a weird problem. I downloaded JW Player and used it on my page (Default Page Content Type) to show video. It worked seamlessly. Now there was one requirement that there would be a page ...
0
votes
1answer
14 views

Programatically copy an image from user entity to webform submission entity [closed]

Using a custom webform handler, I am trying to copy an image from the image field (field_usr_avatar_img) located at the user account page to the image element (avatar_img) located at the webform ...
6
votes
1answer
726 views

Upload multiple files through a single file dialog?

In a Webform, I want to let the user upload multiple files via one call of the file dialog. I found the following modules. Webform Multiple File Upload Webform Multiple File With either of them, I ...
0
votes
0answers
16 views

File uploading issue

We're having issues uploading files. Some files encounter an error message that states The specified file temporary://p1dah901n910tl8lv14.tmp could not be copied, because no file by that name ...
4
votes
2answers
308 views

Detect when 'Remove' is clicked on a file widget form element?

I have a handful of file fields that have the following default Drupal behavior: User can upload a file User can upload another file in place User can remove file Standard config. Whats happening is ...
1
vote
3answers
1k views

Link manually uploaded file to files-private folder

I have uploaded a large size folder via winscp to a external hosted server to the files-private folder in drupal. when i try to access the index file inside the folder in browser i get access denied. ...
1
vote
1answer
347 views

How to load CSS files located outside Drupal's path from within a custom module?

I need to store my css files at a location outside Drupal's path (e.g. /srv/assets/css/my_site/general.css). I attempt to achieve this using drupal_add_css but the browser loads them from: http://www....
0
votes
1answer
26 views

How to define allowed file extensions to file field in installer yaml?

I need to add 2 fields to an existing content type in Drupal 8 website, one is text another is file type, I have a multisite setup so I need to add for every locale site, Now I have created a module ...
2
votes
1answer
585 views

How do I make the file description field required?

In Drupal 7, I need users to enter a file description, how do I make this field required? Also on another note, I would love to make this field a select list, there's no clear way to do this aside ...
0
votes
2answers
2k views

How to use managed_file to upload many files

I'm looking for a way to upload many files by means of the managed_file form API element. I would like it be like while uploading for node where is 'add new item' button. How to do it?
0
votes
1answer
575 views

Customize Commerce Event Ticket PDF content

I'm running Drupal Commerce and Commerce Event Tickets on a client site. I'm trying to figure out how to customize the content of the ticket PDF that is generated by the module, and I'm stumped. It's ...
0
votes
1answer
613 views

How to download the files data attached to webform

I have webform with text fields and file upload field. How can i download the all the documents which was uploaded through this webform.
0
votes
1answer
59 views

Drupal 8.7.0 chmod() and touch() operations not permitted

After updating drupal8 for 8.7.0 and then to 8.7.1 versions i have next errors: Warning: chmod(): Operation not permitted in Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage->save() (line ...
1
vote
2answers
616 views

Hide Alt and Title for image field

How to hide Alt and Title fields for anonymus users when they upload images? I use tokens for these field that's why I need to hide them.
0
votes
1answer
32 views

How do I override the base URL for private files?

Why in Drupal 8 is possible to override the base_url for public files using the file_public_base_url but not for private files? There are scenenarios where Drupal is installed behind a reverse proxy. ...
-1
votes
1answer
359 views

How to set title for video embed field

I've a video embed field, where I've a youtube video link, I've printed the same on the twig. But it seems not to have the title for the iframe. How can I add one for iframe in drupal 8.
0
votes
0answers
24 views

Steps to make a private file system working on a fresh install?

How can i make my media files stored as private and protected? The users shoud only have access to that file if they click from the node file link, on nodes they can access to. On a fresh install,the ...
2
votes
2answers
668 views

How can I attach multiple pdfs to drupal_mail() function?

Was doing something like this global $base_url; $uri = $base_url . '/sites/default/files/test.pdf'; if(!empty($mail_content)) { /*send mail */ $to =$...
0
votes
0answers
30 views

Prompt user to download file via AJAX form submission

I have a file that is generated when an AJAX button is clicked. I want to immediately have a file download prompt come up. The file is being generated and has the correct data in the file. I just don'...
0
votes
0answers
32 views

Images not being uploaded to defined Image Style folder on server

Drupal 7 site. For over 5 years we've had no trouble uploading images to view with a blog. This weekend we had Ningx loaded on our server. Hosting co. is certain that's not issue. Maybe it isn't. ...