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
2
votes
1answer
931 views

Clear managed_file field on submit

I'd like to clear the managed file field each time the contents are sent off for further processing on submit. The callbacks work fine, but I have repeatedly come unstuck in my goal of having a "...
1
vote
1answer
1k views

Retrieve File Url from Upload Form When Form is submitted

I have the following code in my form. function video_subtitles_menu() { //print "video_subtitles_menu 1";exit; $items = array(); $items['video_subtitles_test/upload'] = array( //this creates ...
0
votes
3answers
1k 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
339 views

how to display dynamic field values to template?

I am making a module, each time user make content type and add fields to it, all its field values get rendered into static template dynamically. For This i am using noad_load_multiple() to get all ...
1
vote
1answer
233 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....
4
votes
2answers
1k views

How to select files from /sites/default/files with IMCE filebrowser?

Somehow the settings of directories in the configuration of IMCE (7.x-1.7) is pointing to <root>/. which lets met start in the private_files directory but not in the (public) files directory. I ...
0
votes
1answer
1k 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 ...
2
votes
2answers
867 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 ...
2
votes
1answer
35 views

How to alter file upload description text

I'm trying to customize text for a file upload widget in Drupal 8. Here is a screenshot of the widget: I just want to display the first 15 MB which I added as file field description text in the ...
0
votes
0answers
31 views

How can I upload an image in a custom form and save the result in a custom database table?

I have a custom form and I want to store the values in a custom database table. After submitting the form, the first_name and email_address fields are successfully saved to the database, but image ...
0
votes
1answer
363 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('...
4
votes
2answers
1k views

Upload file and fill in fields in one step; or trigger a rule when a file is uploaded

I want to make use of the Media module and the File entity module to upload files, in particular images, to my site without having to attach them to a node. Solely uploading images works like a charm, ...
1
vote
1answer
2k views

Display Auto Generated Youtube Thumbnails with 'Video Embed Field' Module in Views

I added some videos to my site and I'm using views to display them. I followed a tutorial and i used the rewrite the output option of the view with allowed replacement patterns to display videos in ...
2
votes
1answer
801 views

How to show list & thumbnail widget in plupload?

I have installed the following modules: FileField Sources Plupload, FileField Sources, Plupload module and added latest plupload library. While uploading multiple files it is showing only list of ...
1
vote
1answer
1k views

How to add delete button to file field upload widget that actually deletes the file (not just association with content)?

After uploading a file with the File widget for the File field, the file is on the server and remove only disassociates the file from the field (and the content that the field belongs to). I would ...
1
vote
3answers
273 views

Access uploaded file by ID

I have a webform that allows users to upload their CV/Resume's. The webform is sending me the file ID. I know that the URL for accessing those files is https:// example.com/sites/default/files/webform/...
1
vote
1answer
863 views

File field upload in modal/dialog

I have a custom content type with file field as one of the fields. For theming/UI purposes I should make this file field as clickable button. And only when user clicks on it, he/she gets modal window ...
0
votes
2answers
708 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 ...
0
votes
1answer
355 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
1answer
24 views

Add extra text input for file field

For Drupal 7, in page content type there is a multiple file upload section. Description is enabled for the file upload, but I need to add one more text input for each images to ask user enter the year ...
0
votes
2answers
380 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 ...
0
votes
1answer
376 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
23 views

How to add Download link to File field

I would like to know how I can make File field type display the upload as a download link, instead of having a link. So that user can just click and it will download). The file field type, I added to ...
1
vote
1answer
852 views

How can I get webform file upload to display a thumbnail instead of a link?

I have a webform with a file field. When I upload the file I want to return a thumbnail of the file. Is this possible? If so how can I achieve this?
0
votes
0answers
30 views

When I try to load an media entity with $mid and entityTypeManager->getStorage get nothing

I'm trying to generate a field formatter, and I get this error: Error: Call to a member function getStorage() on null en Drupal\svg_url\Plugin\Field\FieldFormatter\Url4SvgFieldFormatter->...
0
votes
2answers
11k 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 ...
1
vote
0answers
109 views

How can I re-populate file_usage and file_managed tables?

I have a commerce website. I am also consuming a web service and creating corresponding products, including matching products with another table's rows. I have the below code. It ran several times and ...
1
vote
1answer
978 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
416 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
1answer
326 views

Uploading youtube videos to the site

I would like to be able to upload youtube videos to the new site I am currently building. I would like to have a page which will list ALL the youtube videos uploaded, and then on the homepage, I would ...
1
vote
3answers
472 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 ...
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
7k views

Embed and display PDF viewer

I'm looking for a solution to display some of my PDF files with a viewer. I found many solutions for Drupal 7 but not yet for Drupal 8. Is there any module or open source solution to display PDFs ...
0
votes
1answer
350 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
3answers
978 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
0answers
33 views

Create a link to a private file from just a file id?

I am building a controller that returns a rendered HTML Response object to an AJAX request in the theme. I need to display a button that contains a link to a private file. I tried to mimic what the ...
1
vote
2answers
367 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
354 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
0answers
13 views

How to get the node title which is related to file in File usage view?

I am just trying to list out the nodes which are linked to files in the File Usage view. That will show up in this URL: /admin/structure/views/view/files/edit/page_2. In this view I tried to add ...
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 ...
0
votes
0answers
44 views

How can I read uploaded CSV file data and create nodes from it?

I have created custom module. but don't know how to read uploaded file data and add into perticular content type. HTML File upload is displayed but after upload file unable to read content. function ...
1
vote
0answers
19 views

Bug remove file button in webform multi upload file

Module: Webform 8.x-5.5 Context: Multi file upload webform Bug: When I'm removing a file from the uploaded list, the label of all the file disapear... But, when I upload an other file, they all ...
0
votes
1answer
373 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
440 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?
1
vote
1answer
590 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 ...
1
vote
0answers
81 views

Why would redirected files create 404's at website's root? [closed]

When my Drupal 7 site was built (not by me), there was a schematic file field created within our "Tool" nodes to upload tool schematics PDF files with the file directory set to sites/default/files/...
3
votes
2answers
882 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
1answer
333 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. ...
3
votes
2answers
420 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 ...
4
votes
2answers
933 views

Prevent directory permissions of sites/default from being protected in a local environment?

Drupal automatically changes the directory permissions of sites/default to 555 (i.e. read-only), which means that if I'm editing sites/default/settings.php, even if I've set the permissions for that ...

1 2 3 4 5 47