We changed our privacy policy. Read more.

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
6 views

Files migration from local dev site

I'm migrating from Drupal 7 to Drupal 9 and am having an issue with my source files getting found with the upgrade_d7_file migration. My public files directory for my source site is not 'sites/default/...
-1
votes
0answers
14 views

Is it possible to display an uploaded document file pdf on the website?

I would like to display pdf files sent in a webform submission directly in my browser. The problem that happens is that these files are in the private directory of my drupal site. I downloaded and ...
-1
votes
0answers
15 views

How to merge all webform submissions files?

I have a webform where users upload PDF files. I would like to be able to merge all the PDF files by webform submissions. Is it possible? If yes, how?
0
votes
0answers
19 views

Getting different Public path for admin and anonymous users

My site was built using Lightning Drupal distribution. I had my public path as /sites/default/files. I did change the configuration path to /sites/<my_domain>/files in the middle of the project. ...
0
votes
1answer
27 views

Ckeditor inline images path

I am running a Drupal 9 site and I expect my users to upload a lot of files with the ckeditor functionality. All of those files will be stored in a single folder. I heard that this will cause ...
2
votes
0answers
27 views

S3FS IMCE File upload issue for old files in Upgraded site

I have a question on IMCE File upload. Hope someone might have come across the similar issue. Installed modules: https://www.drupal.org/project/s3fs https://www.drupal.org/project/imce We have added ...
0
votes
1answer
20 views

Downloading xlsm is disabled for anonymous user: What function is responsible for this access control?

We have a D7.8 site with Panopoly 7.x-1.81. No access control modules. A standard filefield is used for uploads and functions perfectly for the usual set of mime types. We recently extended the list ...
1
vote
0answers
48 views

How to programmatically grant access to private files?

I was working under the idea that i could use hook_file_download to grant access to private files; but it seems that this hook can only be used to restrict access to files, not to grant access. I have ...
1
vote
1answer
25 views

How can I delete a file served by a custom controller after it has been downloaded?

Starting from How do I create a file download URL? I've build a custom controller that allows users to download a PDF file. my_module.routing.yml my_module.pdf_link: path: '/my-module/pdf/download' ...
0
votes
1answer
27 views

How do you set the file extension while uploading images through file_save_data?

I am trying to create a product with a product image on drupal using API. I have created a custom module for the same under which following code to upload my image to the Drupal: $path = base64_decode(...
0
votes
0answers
19 views

Image is not showing on the product edit page after creating the product using API

I am trying to create a product with a product image on drupal using API. There was nothing given regarding uploading an image in API so I created a custom module under which i used this code to ...
2
votes
0answers
30 views

How are compiled CSS and JavaScript files handled with S3?

I have my Drupal site set up to upload public files into the S3 bucket but am having some strange behavior with different environments and different s3 buckets. I have 3 s3 buckets: one for our ...
1
vote
0answers
14 views

Managed file element in custom field module doesn't save target id

I have been breaking my head on this issue for a few days now. Using Drupal 9.2.x, I am building a custom field module for a client that has multiple fields. I isolated the problem by only including a ...
0
votes
0answers
32 views

Is it possible to generate a link to a private file that can be shared with an anonymous user to download the file?

In Drupal 8 we need to generate a link to a private file that can be shared with an anonymous user to access. In our function we have the file object for the private file and are currently generating ...
0
votes
1answer
15 views

Front and backend public files not found [closed]

I'm trying to display some image in my front and my backend, a simple image, not a media, but I'm always receiving a 404. For example, I'm trying to display the icon from my paragraph, to i'm ...
1
vote
2answers
35 views

?_format=json does not produce JSON for files, REST

I am using Drupal 9.3 with REST UI, RESTful Web Services, and Serialization enabled. For the REST UI, I have the following configuration for files: Methods: GET, POST, DELETE, PATCH Accepted request ...
1
vote
0answers
37 views

Why can't admin access private file?

I have a file field as part of a Paragraph. The Paragraph is attached to a node bundle. Each paragraph can hold a single file. I have added the same file to the node (each in its own paragraph) ...
-1
votes
1answer
31 views

Download Single Webform Submission CSV

I would like to download the webform submissions one by one. Currently the core of Webform owns to download all submission data to a CSV. Webform -> Result -> Download How to download one ...
0
votes
0answers
21 views

How can I change the "sites/default" into "web/sites/subsite" on the new location?

I have moved the content (files and database) of my "traditional" site (no composer, single site, using sites/default/files folder ) to a subsite on a multi-site that is created using ...
0
votes
0answers
16 views

How to get the file destination from a content type's field_image to upload programatically

I have a cron job that goes and grabs content from another resource and uploads it into my drupal site, and this includes a link an image that I retrieve and upload into my S3 file system. My site's ...
0
votes
0answers
27 views

How to decode base64 image using pre save hook?

I am uploading image using jsonapi. But here the data is base64 format (As per requirement). Uploading to media entity. So I need to write a hook media entity pre save so that file uploaded should be ...
1
vote
0answers
67 views

How can I have the file upload destination private by default?

Currently Webform file component uses public files as default upload destination. This is probably because private files path is not always available if not configured in Drupal settings correctly. ...
1
vote
0answers
47 views

How to programmatically update a file uri in a node

I'm programmatically moving a pdf file and then trying to update the uri in the node. Here's my code: $node = \Drupal\node\Entity\Node::load($nid); $entity = $node->field_pdf->entity; if ($...
0
votes
1answer
41 views

How to send dynamic content as an attachment file in email?

Normally we send files as attachments in the email if they are stored in the file system. $file->uri = 'sites/default/files/file_name.pdf'; // File path $file->filename = 'file_name.pdf'; //File ...
-2
votes
1answer
245 views

Auto delete temporary files after 15 seconds of creation

The default setting given to delete temp files is after 6 hours minimum. I have users upload files and I want that if it has temp status, delete it after 15 secs. Tweaking the file module code is ...
0
votes
0answers
25 views

How can I assign multiple files to the same field in a migration lookup?

In a first migration step, I import files. Therefore, I read a csv file, containing filenames and attributes about the files. Files can share the same attribute like so: file,attribute,... ex1.pdf,666,...
0
votes
1answer
59 views

How can I upload and read an unmanaged file?

On a custom form I have a file field. Having chosen the file and clicked Submit, I'm trying to find how to access and read the uploaded file. I have no need to move or save it, I simply need to open ...
0
votes
0answers
106 views

How to work around check for `sites/default/files` during Drupal installation, if you're not planning on using it?

I'm working with a server where I don't have shell access and I've dropped the database in an attempt to reinstall Drupal (having run into issues with a failed deployment). When I try to step through ...
0
votes
0answers
34 views

After the update 8.7.14 to 8.8, the File module causes error when uploading a file

After updating Drupal 8.7.14 to 8.8, I have a problem with the File module: When I upload a file, I get the This value cannot be zero error message. The file is however present in the site/default/...
2
votes
0answers
37 views

Theming a file link by adding custom file name suggestions

I want to display a bunch of data inside a view table, where each dataset has up to three different files. The user should be able to download these files by clicking a custom button or image in this ...
0
votes
0answers
15 views

Error copying file. Is there a permissions issue?

I have a process that fetches a file, then moves it (overwriting if already exists). The copy part fails, and I cannot determine why. Here is some PHP I am using to reproduce the issue I am seeing (...
-2
votes
1answer
65 views

Why doesn't file load by URI?

I have a file URI something like private://somefolder/myfile.pdf. Certain users don't have access to the file so I am trying to change that using hook_file_download($uri). In that code I need to load ...
0
votes
0answers
7 views

How to display uploaded files with uncommon extensions using file field?

I have a standard Drupal file field to upload different files via this field. I have set the "allowed extensions" to: txt, pdf, doc, docx, pages, key, ppt, pptx, numbers, xls, xlsx, csv, tar,...
1
vote
0answers
47 views

Problems with file migration

I'm in the process of migrating a fairly large old site that has been migrated from Drupal 6 to Drupal 7, and now to Drupal 8. There are a few issues about getting this done, but I have a grip on most ...
0
votes
1answer
183 views

How can I fix this error and upload files?

I have a simple form with just a field to upload a file on a Drupal 8 site using the Webform module 6.0.1. If I test the form using webforms test tool, the file gets uploaded fine, it displays the ...
0
votes
0answers
31 views

Get the URL to use it in an <a> tag in a file field

I'm looking to print out the url for a file in a Drupal File field in the twig template. I'm doing this inside a paragraph twig file. I've followed a similar answers on stack overflow but to no joy. ...
1
vote
1answer
106 views

Permanent Deleting of files still doesn't work for me (make_unused_managed_files_temporary = true)

make_unused_managed_files_temporary didn't work for me. I am using Drupal backend for the REST API frontend application. Thats how the File input looks (because I am not sure if that setting is for ...
0
votes
0answers
25 views

Ajax callback to create paragraphs on form

I'm trying to create a way that an end user can upload a csv into a node form and it automatically extracts the content and then creates paragraphs in the form. I have created a custom managed file ...
0
votes
1answer
52 views

Migration with custom files path

I have to migrate a website from Drupal 7 to Drupal 9. My Drupal 7 files were located in this directory : sites/mywebsite/files In Drupal 9, files will be located in this directory : sites/default/...
3
votes
0answers
42 views

Cannot delete file due to empty entity reference

I have been asked to delete a file that has incorrect legal information on it from a website so it has to go. My users could not do it. The site is running drupal 8.9.13 and I have installed the ...
0
votes
0answers
25 views

Can't upload anonymously using webform

I am using varbase 9.0.0-rc1 distribution I have successfully uploaded files using the forms while I am logged in. But anonymously I get the following error: An error occurred while attempting to ...
0
votes
1answer
113 views

Why does the upload progress bar reset at 40% when uploading large files?

I'm uploading a 5 GB file and the upload progress bar resets at 40%. When it gets to 40% it starts counting again from 0%. Eventually the file does upload completely but this is not good UX. I was ...
0
votes
0answers
52 views

How to migrate PDF files to specific node

I have a directory with PDF files and I have 45 nodes of content type Download. I have to migrate each PDF file to specific node. All PDF file names I read from a CSV. Before these PDF files, I had to ...
0
votes
1answer
130 views

Cannot upload file of type image

I am experiencing a really strange behavior I have never seen before with Drupal. I am able to upload files of every type but not images. The files system is public. The problem appears on the local ...
0
votes
0answers
87 views

How to upload multiple files in a custom form with Form API [duplicate]

I have a custom form created with Form API. In this form, I have a file field with the type managed_file $form['fichiers_justificatif'] = array( '#type' => 'managed_file', '#title' => '...
0
votes
0answers
35 views

How can I import a file content?

Using feeds, given a URL, I would like to get the content of a file into a node text field. In the case of an image, I can map the image URL to a image field and see the images on the page. If I do ...
0
votes
0answers
65 views

S3FS S3 module image source issue

I'm using the S3FS module to use an AWS S3 bucket as my sites/default/files directory. When I upload images they are successfully uploading to the bucket. I edit a node and include the same images via ...
1
vote
1answer
18 views

testing scheduled file deletions

Long story short, is there a correct way to override DRUPAL_MAXIMUM_TEMP_FILE_AGE? I'm working on testing a fix to a module I wrote a while back that handles some uploaded files. I neglected to call ...
0
votes
2answers
141 views

Image Files Uploaded via REST got Temporary status - Cannot be refereced by Media Image

Drupal 8.9.11 Image File Uploaded via REST gets "status - Temporary" while setting explicitly "status" case to True server error 403 (code in python) "status": [ ...
0
votes
0answers
43 views

FlySystem problem, file can not be uploaded into directly that exists

I had created a question in order to config FlySystem module correctly for Drupal 8 to work with ftp. you can see it here. fortunately with @mbomb007 helps, I could do it. but another problem happened ...

1
2 3 4 5
49