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
1answer
311 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
40 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, ...
1
vote
0answers
292 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). ...
1
vote
1answer
54 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
25 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
52 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
23 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
370 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
2answers
48 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
158 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
2k 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
39 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
317 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
50 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 ...
0
votes
0answers
40 views

Files folder changes permissions randomly

It seems that the sites/default/files folder of a project looses the permissions from time to time - and I have no idea how it comes. Suddenly error logs appear stating that the public files folder ...
0
votes
1answer
30 views

Trouble recreating my site locally

My online site gives "server encountered an unexpected error" and the shared hosting site (1and1) gives no log access. So I am trying to recreate my site at home. I started with a clean install of D8....
0
votes
1answer
85 views

How do I add updated timestamp to a file url to ensure people download the latest version?

I'd like to add the last updated timestamp to the uploaded file name e.g. my.pdf?ver=123413414 The file is uploaded on a regular basis and I'd like people to access the latest version. I can't see ...
0
votes
1answer
867 views

How can I override template_preprocess_file_link function?

I want to print file size near file link in file-link.html.twig template. To do so I need something like {{ filesize }} variable avaiable in template. I tried to override ...
0
votes
1answer
627 views

403 forbidden error when loading images in test server

Am working with drupal7.When images are loading below error is showing in my test site console: GET sites/default/files/styles/slideshow_full/public/plans/30989/main-image/...
0
votes
1answer
144 views

PDF Preview module not working in ubuntu for Drupal 8.5 version

PDF Preview module not creating the image(first page of PDF) in docker (Ubuntu) for Drupal 8.5 version. I have installed imagick(configured the exce path in imagetoolkit module) and Ghostscript and ...
0
votes
2answers
591 views

Change the name of uploaded file based on content type and entity id

Consider this pattern : [content type]-[entity ID].[file:ffp-extension-original] is there any hook so I can change the uploaded file name based on content type and node ID in drupal 8? PS: I ...
1
vote
1answer
127 views

Download all files attached on a site

I have researched a little bit and I haven't found a sound solution to downloading all attached files from all content types across an entire site in an single action. I have found a couple modules ...
1
vote
1answer
20 views

Can I check a file's properties before saving it with system_retrieve_file?

My understanding of system_retrieve_file is that it saves the file temporarily first. Is it possible to check this file and if it passes, then save it? I've only used this function like below. $...
1
vote
1answer
211 views

How to recalculate uploaded files' sizes in KB and update the values in the database?

I use a shell command to look for all uploaded JPEG files above 500 K.B. (originals) and do JPEG compression on them. They get smaller in size, but Drupal still shows the originally uploaded file size....
0
votes
2answers
622 views

file_save_data doesn't save image

I'm using Drupal 7.56.. I want to upload images from other urls.. I use: $image_original_path = '.. here my original path..'; $my_destination = 'sites/default/files/images/'; $my_new_name = 'my_image....
0
votes
1answer
233 views

Can't get fid of the saved file after file_save_data

I have been trying to get the fid of the file which my custom module is saving and every time I end up getting the error "Trying to get property of non-object in report()". I have tried file_object->...
0
votes
1answer
2k views

Display the size and format of a file attached to an article

I'm trying to display the format and size of a file attached to an article. Its system name is field_file. So far, I've succeeded to load an article in my my_theme.theme file and the field_file ...
1
vote
1answer
292 views

AJAX 500 using In Place Editor to upload managed_file image

I have a plugin that allows the user to upload an image using managed_file to use as a bg image. While using the In-Place editor, I get a Ajax 500 error when trying to upload. I will post my watchdog ...
0
votes
1answer
408 views

Image styles are not created 404 Not Found

I'm running on Nginx. All permissions are set to 777 and owner is www-data:www-data. Create/edit a node with image_field, upload an image. Original image is uploaded and stored at sites/default/files/...
0
votes
1answer
291 views

Let custom module access private files via file_get_contents

I have a custom module (Drupal 7) where I want to read the contents of a file using file_get_contents($file) in the private directory. Theres a access denied error, as the module accesses as anonymous....
0
votes
1answer
158 views

What hook should I use to alter the File Upload field in Webform 7.x-4.16

In Drupal 7 Webform file field, might there be a way to access the link provided after the a file is uploaded? The reason is that we have a hot-folder/watch-folder process that runs, cleans a file, ...
0
votes
2answers
676 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 ...
0
votes
1answer
191 views

Downloading from private directory corrupting some file types

We have set up a private file system on a website based on drupal's guidelines. We are using Drupal 8. We have setup the private file directory outsite of /var/www at /var/privatefiles. When ...
0
votes
2answers
2k views

CKEditor and IMCE: how to access to public files directory

I have a problem that I can't access public files directory from IMCE as file browser (and CKEDITOR as editor). When an user write a blog post, he can't upload images to public directory because this ...
1
vote
2answers
806 views

How can I stop auto uploading of managed_file elements?

I am trying to create a field to upload the xml format of site map. But when I add a file to my filed it automatically uploaded and saved in the S3 bucket before I click on the submit button. The ...
-1
votes
1answer
543 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
284 views

Download true file name instead of from drupal version changed filename

i have some file upload fields which works great. the file is stored on public file system and will be able to get downloaded from the users (in a specific node). the issue is when i update the file (...
3
votes
3answers
4k 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
2answers
116 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
378 views

Document viewer for the uploaded files

I had been using a module called "filebrowser" for implementing the file management system. This provides with a content type "Directory Listing" (listing all the uploaded files) through which a node ...
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
23 views

Why am I seeing so many duplicate images in my thumnails folders?

Why am I seeing tons of duplicate images in my sites/default/files/data_export_import/styles/test_thumbnails There are so many in there, like 4 gigs, I'm going over quota, how can I clear this and ...
1
vote
0answers
160 views

How to get all the image files and clean them up on Drupal 8?

On my Drupal 8 website I have created multiple media contents and uploaded image file to each content. When I update new image of a media content, the old image file remains unused in the image ...
2
votes
1answer
188 views

PHPUnitTest is missing the file_managed table?

My PHPUnit test is throwing an error saying that my file_managed test database table does not exist. What module do I need to include for that test table to get created? I would think it should be the ...
3
votes
0answers
80 views

How do I use hook_entity_access() to let anonymous users upload private files?

I have same issue described in How to skip the ReferenceAccess constraint on a file upload by an anonymous user? So I need to use hook_entity_access() or hook_ENTITY_TYPE_access() to solve the issue. ...
1
vote
2answers
1k views

How to Embedd youtube video in body field (converts URLs into embedded players)? [closed]

Is there a simple way to insert youtube video in body field like other CMS where you copy a youtube link in the article body and it is automatically converted into a video player in front end. I’ve ...
1
vote
0answers
596 views

What permissions should I set in Drupal core files?

I get a very long message when flushing the caches, starting with Warning: unlink(/[my-website]/sites/default/files/css/css_mXyk_ET1j0oQS97qAccqHtOxn-21f8f9PeabB5s5OTE.css.gz): Permission denied in ...
1
vote
0answers
56 views

File value is NULL in custom file field type

I am creating a Custom field type for "file upload" functionality that contains a File form. This is the code I am using. /** * Plugin implementation of the 'AkamaiUpload' field type. * * @...
0
votes
1answer
955 views

How to change default file system path in D8?

In D8, where to change the Public File System Path to be : sites/default/files/[nodeID]/ Do I need write a module?
0
votes
1answer
44 views

Saving File Space with Drupal 8

I have a hosting account which has a maximum of 250 MB total space. I have installed Drupal 8 and I'm using the bootstrap theme and already my host has warned me that I am nearing my limit for file ...