The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
0
votes
0answers
4 views

Videos and PDF's not displayed on mapping with domain

I am using Drupal version 8.7.7 in which using vdieo.js and pdf.js to display embed video and pdf files. On VM IP both files are rendering fine but on mapping, with the domain, both viewers are not ...
0
votes
1answer
454 views

Get file ID and path to use in View template

I am working in my Row style template (views-view-fields--MYVIEW--block-1.tpl.php). I need to get the file ID and path of an image. The image field is a multi field, so I need to get all of the images ...
2
votes
1answer
469 views

How to redirect all images in the files folder to a default file?

Because we work with DTAP environments, our developers work on their own laptops. To get a good view of the live environment, we copy the PROD database and the files to our own laptop. However, this ...
1
vote
1answer
512 views

How to eliminate direct access to files in private directory?

I have set up my Drupal 7 site for private files in a directory above root (../private). I also set my filefield on my node type to upload the image files to that private directory. I have two user ...
2
votes
2answers
514 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 ...
0
votes
1answer
353 views

Adding zip archives to the Document File Type

I have many PDF documents in my site, assigned to the Document File Type by the File Entity Module. I have added a few fields to the content type, thus allowing nice interface in showing all PDF ...
0
votes
1answer
535 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 ?
0
votes
2answers
34 views

How to reuse existing images in field type “Image”

I have custom ContentType with one field of type Image. Currently, when I edit a node I can only upload new images from local to server. I want to have the option to select images already existing on ...
0
votes
1answer
11 views

Modify the error message about the maximum upload file size

I would like to modify the default error message for the maximum upload file size, but I can't find the configuration. I looked at webform general settings, individual settings, and media file ...
0
votes
0answers
24 views

Upload button not showing

I am using Drupal 8.4.2. I have created my content type and I have an image field in the form fields. The image upload field is showing on the page but, the upload button is not showing. If I ...
2
votes
1answer
348 views

How to get an export option as a pdf for views?

I am using views on my Drupal site I can able to export my view in csv, but I am not able export my views as pdf I need to export my view as pdf. Any suggestions on this it will be very helpful, ...
0
votes
2answers
497 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
391 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
0answers
44 views

Detect when a new image is uploaded to my server

I have created a custom app that will allow logged in users to upload an image which will be automatically uploaded to my web server through SFTP method. Is there a module or even programmatically ...
0
votes
1answer
536 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 ...
1
vote
4answers
511 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
2answers
785 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
2answers
364 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
0answers
23 views

Remote File Upload with URL Parameters

I'm currently using a digital asset management tool that allows us to host images as a CDN. The DAM allows us to crop and position the image using URL parameters (example: https://embed.widencdn.net/...
0
votes
2answers
674 views

RewriteRule causing internal redirect limit error

I am trying to server a static HTML site from /sites/default/files/staticsite and make it available via a subdomain. I'm hosting the site on Acquia Cloud, and their docs describe Maintaining a static ...
4
votes
3answers
2k views

How to allow for files of any extension to be uploaded?

I'm surprised this hasn't been asked before like this. I want to allow users to upload files of all file extensions, without enabling each extension by hand. How do I do it?
0
votes
1answer
24 views

How can I register an already uploaded unmanaged file as managed file?

I am stuck in a point that should be easy but I couldn't figure it out. To make a long story short; I uploaded manually some images to the public directory and now I want to register them as managed ...
2
votes
1answer
555 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 ...
-2
votes
0answers
30 views

How to add static HTML pages to Drupal?

I am working on a Drupal 8 site in which I want to link to a brochure I have locally. The brochure contains static html, css and javascript files(also index.html). What I need to include these files ...
0
votes
1answer
927 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 ...
1
vote
1answer
1k 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
11 views

Storage API + Services 3: How to work together?

I am trying to set up a site that will be storing a large amount of images. I am using Storage API module for that and It is working fine through web. Now I need a REST Service to upload images. I am ...
2
votes
1answer
842 views

Unable to set file upload destination private when programmatically creating new content type with file field

I am creating a module to upload video to an in house media converter - as part of the module installation I create a new content type called "user video" which has a file field as part of it. I need ...
0
votes
1answer
22 views

The security danger of publicly exposing an upload field

On older drupal 7 websites I once faced security patches for the webform module, because file upload fields were considered insecure. There was en exploit where people could end up uploading .html ...
0
votes
0answers
37 views

Download pdf files directly to a directory in my server

I am using the Entity Print to generate pdf files out of nodes and is working as expected; However, currently when i click on the https://example.com/entityprint/pdf/node/15, a pdf file of the /node/...
1
vote
2answers
140 views

Field formatter module throws cannot declare class error

I am trying to write a custom module, which defines a field formatter plugin, but when I visit the Manage display page, I get this error: Fatal error: Cannot declare class Drupal\my_formatter\...
0
votes
1answer
555 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
555 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
12 views

Change path of uploaded files in zip

I've a form that allow the customer to download every photos that a photograph uploaded before. Here is my submit form : public function submitForm(array &$form, FormStateInterface $form_state) ...
0
votes
1answer
892 views

The “Remove” button is not working

I'm using a "managed file" to upload an image, which works fine, but if you want to remove the image by clicking on the "Remove" button, nothing happens. $form['logo'] = array( '#type' => '...
6
votes
1answer
900 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
1answer
654 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.
1
vote
1answer
378 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....
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. ...
0
votes
1answer
584 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
0answers
27 views

Phar not working in Drupal 8

If I try to use a simple Phar call in my controller: $tar = new \PharData('/path/to/myTar.tar'); I get the error: "Unexpected file extension" This is because Drupal Security checks to see if the ...
2
votes
2answers
702 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 =$...
1
vote
2answers
399 views

Delete unmanaged file after download?

In a custom module I create a file and then use drupal_goto to download it. How can I delete the file after it is downloaded? Placing a file_unmanaged_delete after the drupal_goto doesn't get executed,...
9
votes
1answer
3k 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 = ...
4
votes
2answers
6k views

How can I load a File entity?

I want to find out whether a physical file is managed by Drupal and if it is, then load it. I'm having trouble with the documentation which keeps displaying "File not found" at crucial moments, but ...
1
vote
2answers
631 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
412 views

How to add Table of Contents in a PDF?

I am using the Drupal Print module to create downloadable PDF from my site. This works very well indeed. But I would like to have a table of contents in the left region of the downloaded PDF. For ...
0
votes
2answers
743 views

Migrating to XAMPP local install - Configure the temporary directory

I have copied a site I have on a VPS down to run from XAMPP on my local machine. When I restore the site using Backup and Migrate I get the error message on all pages of the site: The specified ...
0
votes
1answer
364 views

Youtube Videos won't load and display properly using Embedded Media Field

I just noticed that my youtube videos are not showing up properly now on all my websites running Drupal 6. It seems this happens with any Youtube video which is displayed using the Drupal module " ...
0
votes
1answer
491 views

Theme file upload form element

I want to theme all the file upload fields on my site but I don't know how to name the template file. I want to alter the form-element.html.twig file but as I have multiple file fields I don't think ...