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

How to add file extensions while creating a field (type file) through the module installer.yaml?

I need to add 4 fields to an existing content type in Drupal 8 website, 2 of them is text another 2 is file type, I have a multisite setup and have 30 country-specific sites so I need to add for every ...
-3
votes
0answers
15 views

facing problem files are not downloading on android mobiles [on hold]

i am using drupal7 for my website. also i have created web view android and IOS app for my website. files are downloading properly on laptop, pc, and IOS app. but on android mobile files are not ...
0
votes
1answer
361 views

Get file extensions in drupal exposed filter

I had a content type with a file upload field. The user is restricted to upload files with specified extension in Allowed file extensions settings. I created a view for listing all files. Now i need ...
0
votes
1answer
349 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
0answers
18 views

Follow symlinks inside of default/files

I am running Drupal 8.7.6. The default/files directory is a symlinked to a read only mount (/mnt/files_ro). Drupal needs to write inside a few folders as it aggregates and caches assets, so I created ...
0
votes
2answers
722 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
2answers
9k views

Add header and footer for every pages printed

I've used print module version 7.x-2.0. I've used pdf-version and print-friendly-version. Now i want to do two different things. That is, Is it possible to add separate CSS for pdf, html or email ...
-3
votes
1answer
27 views

Upload file to S3 directly instead of using temporary storage

I have one file uploading form in Drupal 8 where I am uploading 3 different assets and they might be around 2gb or more in size. I have the s3fs module enabled and configured properly, but (due to ...
0
votes
2answers
5k views

Unable to upload files. Though the maximum file size limit is 80 MB, can't upload even 50 kb files

I copied a site from localhost to AWS server. I can easily upload files in localhost but when I try uploading in the live site it gives me the error "An unrecoverable error occurred. The uploaded ...
1
vote
2answers
85 views

Cannot download generated files

I have a site (Linux/Drupal/Apache) that generate a .xlsx file from custom code and its saved to files, but after that I cannot download it from drupal, it give permission denied. Forbidden You don'...
0
votes
1answer
151 views

Handle file requests

I'd like to be able to intercept calls to files (.pdf for instance) in order to run some custom code before the user accesses/downloads the file, and add a cover page accordingly. From what I ...
1
vote
2answers
4k views

Apache AddDefaultCharset utf-8 - filename not saving in utf-8

Using file field to upload image which has utf-8 filename, but when it is uploaded to site filename is not saving in utf-8 format.But original name is saved as link in database making it not found ...
5
votes
2answers
15k views

Can't edit settings.php in Drupal 7 - Premission Denied - Can't Write to File via Cpanel File Manager

Trying to edit settings.php via Cpanel File Manager I can CHMOD the file to anything I want and back but can't write to it. I get the following message: Could not write /home/testing&#...
3
votes
0answers
681 views

How to pipe file uploads to subdomain?

I've got a Drupal 7 site on Apache and Varnish, sitting behind the CloudFlare CDN. Everythin on mysite.com goes through cloudflare... I also have a "direct access" subdomain set up at direct.mysite....
0
votes
0answers
49 views

What are the appropriate file security settings and Apache settings for Drupal sites running on a VPS?

I would be grateful for some help on this one - I have looked at the other posts on this subject with interest, but they don't seem quite to fit my situation. I'm not a great Unix expert, but there ...
0
votes
1answer
301 views

Changing default file permissions for group?

I'm not super familiar with the permissions structure in Drupal 7 so I'm not sure if this is actually an Apache question or a Drupal question. I have a style.css file in /sites/all/themes/mytheme/...
0
votes
1answer
84 views

Is it possible to serve a theme from outside the web root?

We have a need to keep a proprietary theme in a directory that isn't readable or writable by a client. At the same time, the client needs to be able to do standard Drupal updates (ie, they will have ...
0
votes
2answers
698 views

CSS Mime Type transferred as Zip in Chrome - 15 second delay

Resource interpreted as Stylesheet but transferred with MIME type application/x-gzip: "http://www.energyjustice.net/modules/system/system.base.css?m7sb47". I turned off the CSS aggregate and ...
3
votes
0answers
1k views

How to set up permissions while using dso as PHP handler? [duplicate]

I'm having all kinds of troubles while setting up my site online. I can't upload new modules and if I try caching this is what I get: Warning: file_put_contents(temporary://filedwZLkV) [function....
0
votes
1answer
66 views

Lots of permissions errors, should the entire site be set to www-data?

This is my first time configuring a lamp stack and I'm running into lots of problems with permissions. Here's an example of one of the errors The specified file temporary://fileChLMzd could not be ...
0
votes
1answer
386 views

control over what prints on first and second page of pdf

I am generating pdf using dompdf and my website is running on Drupal 6. I have a requirement wherein I need to print part of my html on first page and some part on second page in some cases. Also ...
0
votes
0answers
33 views

Force download string as text file

I'm trying to return the results of a db_query as a raw text file. The php solution uses header() to instruct browsers to download content. I've attempted using header() in an AJAX callback function, ...
5
votes
1answer
1k views

Bulk saving nodes with a file field

I'm in the progress of creating a bulk upload function for a Drupal site. Using flash I'm able to upload the files to a specific url that should be able to handle the files. What I want to do, is not ...
2
votes
3answers
5k views

Upload Images to specific folders

how do I upload images (Media) to specific folders inside the default directory? I will have thousands of pictures and would like to have an organized structure of folders. Thanks a lot.
0
votes
0answers
26 views

How to make inline-files private based on role/permission by term

I am using permissions by term (https://www.drupal.org/project/permissions_by_term/) to manage a member-only area on my site. That works out easily and as it should. However, files uploaded in ...
1
vote
2answers
390 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,...
-1
votes
0answers
19 views

ArchiveTar addModify fails when the passed file_uri has a white space in the filename

I trying to build an export function for a node in Drupal 8. This function needs to export a node's data as an Excel file and attached files as a tar.gz file. Like the webform module's download ...
1
vote
2answers
364 views

Mapping existing file against a new content type

I am facing a situation here. I have a content type A with an image field(field_upload_snaps) in it. There is another content type B which also contains an image field(field_valid_snaps). Now user ...
0
votes
1answer
350 views

Picking image from server: FileField_Sources not working

I currently have some nodes that use images. Problem is: every time I want to choose an image, I have to upload it again. It would be much better if I could just use a path picker, which could show ...
0
votes
3answers
814 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
2answers
51 views

Filebrowser thumbnails “can not create img for private://”

I am using Drupal 8.7.5 and PHP 7.3.7 running on Apache 2.4.6. UPDATE: I'm trying to make available a library of images to the public. I chose the content type of 'Directory listing' to do this. In ...
1
vote
3answers
439 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 ...
5
votes
2answers
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 ...
6
votes
2answers
2k views

Reasons for subsequent Broken/missing handler in Views?

In the process of upgrading Drupal 6.x to 7.x I'm facing a problem that makes all my views show nothing relevant. (I believe the problem is here but I'm not sure, I don't know. That's why I'm asking): ...
0
votes
1answer
34 views

Additional file entity fields in widget_form

I've added additional fields to my file entity types and would like to have them in upload widget, just like file description. How can I add my custom fields element using field_widget_form_alter? (...
1
vote
1answer
66 views

How to set the public file path to migrate site files and images through Migrate Drupal UI

I am working on migrating a drupal 7 site to drupal 8 site that has image fields in content types, as well as some pdf files that I am trying to migrate through the Migrate UI. None of those files are ...
0
votes
1answer
332 views

Programmtically add image to custom image field User

I can't figure out how to add image to a custom image field on a sepcific user. $f = file_save_data($user['thumbnailphoto'][0], 'private://profile/'. $data['name'] .'.jpg', FILE_EXISTS_REPLACE); ...
0
votes
1answer
416 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?
10
votes
2answers
8k views

How to get the url of a file field of a given node?

$node->field_file gives me a FileFieldItemList while the first entry seems to be a FileItem. $node->field_file->getValue() gives me an integer (I guess the file id). How can I actually get ...
1
vote
1answer
351 views

How do I fix File Upload After Upgrading to PHP 7

I know this question has been asked a thousand times in a thousand different ways, but none of those solutions have worked for me. Problem: I recently updated from php5 to php7. Whenever I attempt to ...
0
votes
0answers
7 views

Webform includes attachments only on manual resend, but not on initial form submission?

Using Webform and Mimemail to send HTML emails and uploaded files attached to emails. When submitting the form, the file is not attached to the email. The box is ticked: But if you edit the ...
4
votes
2answers
348 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 ...
0
votes
1answer
389 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
1answer
331 views

Keep file download list of each authenticated users

I have a content type "Application" and each "Application" content has a downloadable file. I'd like to keep the downloaded file list, actually node list, & count for each authenticated users. ...
1
vote
1answer
976 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
1answer
435 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 ...
3
votes
2answers
724 views

How to scan a directory to list all sub folders not files

I have a folder (root folder) with thousands of sub folders and *.json files inside sub folders. How can I get list of sub folder names inside folder (root folder) using file_scan_directory?
0
votes
2answers
847 views

Private file system, The upload directory private://webform/XXXX/_sid_ for the file field could not be created or is not accessible

I am trying to set up the private file system for drupal 8. I have created a private folder /home/user/public_html/private_files with permissions set to 777 in settings.php i uncommented the $...
0
votes
1answer
364 views

Custom feed tamper plugin to convert an image GUID into a URI

I have a feed importer for image files, which stores a column in my source csv as the GUID of the final files in Drupal. I also have another importer for, say, articles. In the articles csv, there is ...
0
votes
1answer
362 views

Problem with swfobject_api or jwplayer module

I have a problem with swfobject_api or jwplayer module. When I use this code in node.tpl.php everything is fine. $config='sample'; $flashVars=array( 'file' => 'path to flv' ); print theme('...