Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
1 answer
546 views

Preview is not showing after upload

When i am trying to upload image as a Authenticate user, After upload i am not able to see preview. fields got disappear fully. If i try to do as a admin, i am able to see that. Any suggestions?
9 votes
3 answers
6k views

Site seems to miss the "private" wrapper, how can I fix it?

I can not enable the private folder getting the warning as below: Warning: file_exists(): Unable to find the wrapper "private" - did you forget to enable it when you configured PHP? in ...
0 votes
1 answer
2k views

Large file uploads stop immediately, 404 error

I am having a weird problem with uploading large files in the Drupal admin's file field. I have the size limit set to 500 MB. I also have the php.ini settings for upload size, post size, and memory ...
0 votes
0 answers
16 views

Using Webform to upload a media file?

I have the Media Module enabled and have a Media type defined called Approved Image. This is identical to the standard Image but has just one addtional boolean field called 'authorised'. I can create ...
0 votes
1 answer
529 views

Unable to upload files through RESTful services

I am trying to upload pdf files to webform submission using REST API. Since the Core File Upload functionality did not seem applicable for webform submission, I applied the patch from webform_rest ...
-1 votes
3 answers
114 views

.htaccess file under sites/default/files/ stops css from loading

I'm working on a new installation of Drupal 10.2 and I noticed there's an .htaccess file in the files folder. This file is created automatically by Drupal. When I try to delete it, it gets created ...
0 votes
2 answers
535 views

How to disable a file upload button for anonymous users?

I've created a commerce add to cart form with a file upload field. The user can use this to upload a logo but I don't want anonymous users to be able to do this. I can see that the file module uses ...
0 votes
3 answers
2k views

How to set and use direct files folder path in a multisite installation

Drupal 8 multisite install where First site is on a subdomain one.example.com Second site is in a subfolder one.example.com/two How can files folder for both sites to be accessible via URL/files ...
0 votes
2 answers
564 views

embed photo album hosted on flickr.com using flickr module not showing photo album

I am attempting to use the Flickr module flickr-8.x-1.0-alpha2 along with Flickr API and Colorbox module to display a album of recent photos from Flickr.com. I have setup the API keys. and added ...
1 vote
1 answer
1k views

Can't load library path files

I have added a library to the libraries folder. I have the Libraries API module installed and I wrote this code: function my_module_libraries_info() { $libraries['google-api-php-client'] = array( ...
0 votes
2 answers
25 views

Cannot find file input

Im new here and currently building my first Drupal website. Im having trouble creating a webform because i cant find the file input option to include in the form. When i googled it, i found that the ...
0 votes
2 answers
391 views

How do I display self-hosted video content

What I am trying to do is embed a self-hosted video on a webpage. I have the video uploaded onto the web hosting in mp4, ogv and webm formats; converted where necessary using Miro Video Converter (if ...
0 votes
1 answer
889 views

How to specify the correct private file path in a block

I have a Drupal site at http://example.org/xyz Per the instructions here, I have set up a private file directory outside the web root. So let's say the web root is at /home/public_html/example/xyz ...
0 votes
1 answer
524 views

Move file uploads in webform into subdirectory using hook_webform_submission_presave

I'm using the webform_multiple_file module to let users upload files in a webform. There is a second form component in that form. It's a number. I want to change the upload directory, which is defined ...
0 votes
2 answers
773 views

The file names are not transliterated on upload

I am using Drupal 7 and have transliteration module enabled. I have a file field and I want to have the names of the uploaded files to be transliterated on upload. The url alias for the nodes are ...
5 votes
4 answers
8k views

how to rename file before/after upload

I want to rename an up-loaded file. I have the following code. I have defined a submit handler to do so. function example_form_submit(&$form, FormStateInterface $form_state) { if ($form_state-...
0 votes
1 answer
1k views

"The file phpC128.tmp could not be saved. An unknown error has occurred. File upload error. Could not move uploaded file."

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. ...
2 votes
2 answers
8k views

Get contents of temporary uploaded file

I've uploaded a file in a custom form and I can retrieve the file instance like this: $fid = $form_state->getValue('file')[0]; $file = File::load($fid); How can I get the contents of the file?...
0 votes
1 answer
395 views

How to check if managed_file has uploaded a video and use it in states

I want to disable the submit button in a form for as long as there are no value/uploaded video in a managed_file but I can't seem to find what form name or element property I have to check for in #...
3 votes
1 answer
402 views

Drupal prevents file save on chunked upload because of php.ini max upload size

I'm encountering a tricky problem with my custom file widget (which extends the core file widget). It chunks files so that I don't have to raise upload_max_filesize and post_max_size in php.ini, and ...
0 votes
2 answers
884 views

File validation when the file field isn't required

I have a Drupal 7 custom form where the image or file field is not required. When the form is submitted and no file/image has been uploaded, I get the following errors. Notice: Undefined index: ...
1 vote
2 answers
202 views

Can create directories but can't upload files

When I try to upload a file with a file field, Drupal creates a sites/default/files/2023-10 directory, but can't upload the file. I see this validation error in the UI: "File upload error. Could ...
0 votes
1 answer
436 views

Error when uploading file through Drush on S3 volume

I am using Amazon S3 volume to store the node's attachment. I keep having the following message: file_put_contents(public:///.htaccess): failed to open stream: "DrupalPublicStreamWrapper::stream_open"...
1 vote
1 answer
404 views

How to link an image with a PDF?

Actually, I have a content type with 2 fields, image field (multiple) which will contain some pictures and an attachment field (accept only one file) which is file of type PDF. I have a view where I ...
1 vote
1 answer
663 views

How do you programmatically create a webform with a managed_file type?

I haven't been able to find a single example of how to create a webform with a managed_file type. The webform initially had the type 'file', but needs to be changed to accept multiple attachments. ...
0 votes
1 answer
406 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/...
0 votes
1 answer
404 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
0 answers
41 views

File upload becomes empty after form submit for anonymous users

I've build a form in Drupal 9 with Form API. When logged in as admin, all is working fine. Selecting a file as anonymous works, and the validations are checked. But when I submit the form, the ...
2 votes
1 answer
1k views

Add a custom font with the "PDF using mPDF" module

I made a custom module to create a PDF from a views page. This module depends on PDF using mPDF. I'm now trying to add a custom Google font. This should be the default font when generating a pdf. But ...
1 vote
3 answers
651 views

Uploading file, parsing and displaying data

For a site i am building right now, there is one component that I would want the user to upload a file, where it will be parsed (currently a python script, but can be ported to something else). The ...
1 vote
1 answer
438 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 ...
0 votes
1 answer
527 views

for anonymous user, webform not submitted because of private file

I have one webform which contain the private file field. As admin user: i can upload the file and submit the form. As anonymous user: i can upload the file but while saving the form, i am getting '...
2 votes
3 answers
2k views

How to export custom module form content as PDF file in drupal 7?

I have a custom module with some form fields. I want to submit this form and generate pdf file of user filled values in new tab. I am trying with TCPDF but it doesn't display any fieldset ( as border )...
1 vote
1 answer
406 views

File upload ajax and Radio Buttons not cooperating in registration form

I have enabled Profile 2 and profile Profile2 Registration Path modules on my site and have a really long registration form with lots of fields. I have some radio boxes and file upload fields also. ...
0 votes
1 answer
4k views

How upload a file\image via json api?

I'm trying to upload a file or image on a D9 site via json api. The test is namely to upload the user picture on the user entity. I've been following the documentation or read questions about, but I ...
0 votes
1 answer
453 views

How to manage video content including chapter markers and CC

I'm building a site that has 46+ videos associated with it. I'm using Mediaelement.js. Each video has at least two language .srt files, a .vtt chapter marker file and two video sources, mp4 and WebM. ...
0 votes
2 answers
2k 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
0 answers
20 views

Backup Migrate Error: "Could not create a temporary file to write to.", but /tmp folder is already 777 on Ubuntu server

I'm trying to manually backup using backup and migrate module on Drupal 9.4, but I keep getting this error: Could not create a temporary file to write to. I checked with file system page and it says ...
0 votes
2 answers
708 views

create link to download file

I'm adapting a drupal module to my need. It permit to upload a pdf to insert it into a node add form in an iframe to display the file. I've need also to insert a link to download the previous uploaded ...
5 votes
2 answers
2k views

Displaying the contents of a document file (doc, docx, etc.)

I'm looking for a way to display the contents of an uploaded document file such as a .docx file. In Drupal 6 I used the iPaper module which did the trick as all I needed was api code to connect ...
0 votes
2 answers
642 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": [ ...
2 votes
1 answer
481 views

User can't access own private files via Views

I've set up a private directory sites/default/files/private and use it for a file field. As an admin, everything works as expected when uploading and viewing a private file. As a user who uploads ...
0 votes
1 answer
703 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
1 answer
440 views

No working link to network files

For an intranet solution I would like to add a bunch of rather static links in Drupal to network files which change from time to time and are maintained by people not using Drupal. To achieve this I ...
0 votes
1 answer
1k views

Migrating files from local source are not found

I am migrating from Drupal 7 to Drupal 8 (8.6.9). Both the Drupal 7 and the Drupal 8 site currently run on my local machine. The migration of the public files goes well using: source: plugin: ...
1 vote
1 answer
476 views

How do I track a publicly downloaded file?

I am creating a custom module to track the file download time and user id with a file link or path. I have tried multiple modules but the download the file time tracking option is not available. How I ...
0 votes
1 answer
406 views

How to make uploaded file permanent to node without node submit

My module automatically save new empty node when user create new node and redirect to edit this node. Now, is it possible to make uploaded file on _node_edit form without submitting form? edit: When ...
0 votes
1 answer
2k 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
1 answer
920 views

Permission for private file to anonymous

I have an ad content type, with a file field that is in a private directory when saving the node. Ads and their files are only accesible for authenticated users. I wish I could allow anonymous users ...
0 votes
1 answer
26 views

Creating a file type of epub in commerce

I want to give customers the option of downloading an epub file or a pdf in Drupal Commerce 2. Drupal 10. In admin/structure/media types/document/manage fields I added the document file type epub. ...

1
2 3 4 5
50