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
1
vote
2answers
2k views

Can't use file field in custom form - gives AJAX errors

I'm building my own form for editing certain fields on a node type, and I'm using field_attach_form() to add the fields from that node type to my form. Use field_attach_form() to get the fields added ...
1
vote
2answers
563 views

Import or Programmatically create nodes with Videos

I'm working on a new drupal site which I need to migrate from an existing non-drupal site. I need to be able to import the old blog posts as Article nodes (either through some standard import ...
1
vote
1answer
1k views

Webform, creating customized directories for uploaded files

Newbie and my first question on here. I'm still learning Drupal. So apologies if I missed anything Here is my issue I am using Webform to create an upload page. The user enters an ID(text field) and ...
1
vote
2answers
3k views

Lightbox 2 - Embeded Media Field / Media : Youtube can't play videos on LightBox2

I tried using both 'Embed media field' and 'Media : Youtube' module in D& website to create a content-type field to embed youtube videos and play in on lightbox2. Although images work well with ...
1
vote
1answer
1k views

Services 3 - updating a custom field in a user account

I'm using Postman in Chrome to test my services. I'm sucessfully able to create user accounts using the following: Headers: Content-Type /application/x-www-form-urlencoded X-CSRF-Token ...
1
vote
1answer
2k views

Max File Upload Size set to big, but Ajax Error with old file size

I have changed the upload_max_filesize and the max body size in my php.ini to 15 MB. It used to be 2 MB. Drupal displays the max file size correctly, but when I try to upload files bigger than 2 MB - ...
1
vote
1answer
1k views

Changing the file of a file field (drupal 7)

I have a content type that contains a file field which is always a .zip file. When a file is uploaded I have a module that unzips the file to make a few changes then re zips the file to a new ...
1
vote
1answer
264 views

How to show filesize when content type contains more than one file?

I'm using Drupal 7 and having File 7.14 field installed.I have a content type (named file) containing more than 1 file. I have a view that shows the filesize of all the files of the content of that ...
1
vote
2answers
4k views

The uploaded file likely exceeded the maximum file size (32 MB) that this server supports on remove image

In my taxonomy terms,when I try to edit a term I got this error : An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (32 MB) that this server supports. ...
1
vote
0answers
268 views

Attach multiple files to a node on node_insert and move them to private directory

I used the code below to save files and attach them to the node on node_insert, but the problem only the last file is saved and attached to the node : function MYMODULE_node_insert($node){ // ...
1
vote
1answer
254 views

EVA field: file entities filtered by taxonomy term of attaching node

I have a node type 'XY' with a reference to a taxonomy vocabular 'country'. Also I have a reference to this vocabular in file entities. I have a view with an EVA display. This EVA field is attached ...
0
votes
1answer
61 views

How to show popup for save or view the file?

I am displaying file names as links on the page, when I click on particular link, it should ask the user that, save file or view file something like below image. In my case this popup is not coming, ...
0
votes
1answer
950 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
2answers
773 views

Restricted access url for an image uploaded to private filesystem

I have a custom content type with an image and a file field, both of which are uploaded to the private file system. How do I create a public url to the image that will check for user permissions so ...
0
votes
2answers
1k views

Filefield with IMCE browse server

I am having rather strange issue. I have created custom CCK with image upload field. To browse a server folders I've installed a CCK Filefield and configured it to work with IMCE , however I can't see ...
0
votes
1answer
3k views

Generate PDF with Print PDF and send in email

When a user registers he has to select some options that will be defining for the invoice created afterwards. I have a rule that will be executed when saving a user account. This is what I do: Rule ...
0
votes
1answer
2k views

IMCE image upload and permissions issue

I've implemented the IMCE module and added it to the CKEditor. When we upload files though, the resized images come out fine, but the uploaded file itself is saved in the same directory with incorrect ...
0
votes
3answers
2k views

Managed file validation on first upload only

In D7,I have new_form with a managed_file field to allow my user to upload documents to public://. I'm trying to prevent my user from uploading a document if the file name they are trying to upload ...
0
votes
1answer
102 views

Migration: Combine Profile2 and file migration

I need to migrate profiles from an external database (not drupal) to Drupal 7. The target system uses Profile2 profiles. I already wrote the migration of all the "primitive" fields with the help of ...
0
votes
0answers
110 views

How to Force Visitor to Login after 3 Consecutive Download

My site serves downloadable files. How can I force them to login/register after downloading 3 consecutive files? Is there any available modules for this? If not, is there a sample script to start ...
0
votes
1answer
2k views

Module Installation: Unable to create directory 'temporary://update-extraction-f781a69c/

I have searched the answers on this site and have found threads like Configuring the temporary directory which refer to this issue but could not arrive at a solution. My setup is Linux (Fedora), ...
0
votes
2answers
511 views

I want to import my youtube videos to drupal when I upload a video in YouTube

It will sound stupid but what I want to do is I want to get YouTube videos to my drupal installation. The challenge is one of my clients he wants to see if he can do like while he is walking and ...
0
votes
2answers
4k views

File upload error “Files must be less than x MB” despite file being smaller than x

I have a file field called Video for a content type called Tutorial Video. My settings are thus: Allowed file extensions: txt, mp4 Maximum upload size: [empty] The maximum upload ...
0
votes
1answer
545 views

osx 10.7.5 built-in apache 403 forbidden for sites/default/files/styles [duplicate]

this really drives me crazy .. BTW here is a really nice tutorial i tried - everything. believe me ... from adding users to groups, running apache as different user, chALOT -R (even chmod a+rwx), ...
0
votes
1answer
2k views

“exceeded the maximum file size” error even when uploading small files

This error in my Drupal 7 site happens when I try to upload an image through image_field field. This is the error: An unrecoverable error occurred. The uploaded file likely exceeded the maximum ...
0
votes
2answers
363 views

How to debug missing default value of managed file?

I have a form with images. It also contains title and alt for 3 languages, so when I select them in one query, I get the same managed file fid 3 times. But that's not the problem. Relevant part of ...
0
votes
2answers
142 views

Provide contents of file field at node URL

I'm trying to set up my Drupal website to host files (more specifically, PDFs) at clean URL's and have some download statistics about them. For example, I would like "test.pdf" to be available at "/...
0
votes
1answer
153 views

Folder permissions, owner/groups

I am using the FileField Sources module One of the features is that it allows you to transfer images from a URL to your drupal folder directly, instead of having to save the image on your computer ...
0
votes
1answer
194 views

Create a PDF with one result from a view

I have a view with information from a specific database table and I want users to be able to generate a PDF with the results from one row, which would contain all the information from the row. So far, ...
0
votes
0answers
1k views

Writing custom PHP code in Rules to check if a file field has a new value

I need to create a condition in Rules that evaluates whether a new file has been uploaded to afile field. The file field has an unlimited value setting and I need to send out notifications to users ...
0
votes
1answer
1k views

Ajax fired when Filefield “Add Another Item” button is clicked conflicts with my jquery

I have a node type with a multivalue filefield. I am using some jquery called by my custom module to modify some of the UI in the form, but when I click the "Add Another Item" button it completely ...
0
votes
1answer
221 views

How to change filename before it get saved without changing source URL using tamper plugin?

I've URL which is mapped to file field (image) via Feed Ex. I'm trying to change the filename before it's get saved using tamper plugins (e.g. concat or regex), however it is also changes the ...
0
votes
1answer
671 views

Confusion about files permission

Accrding to drupal docs: The following is an example file listing of a safe configuration showing two files in a site where uploaded files are stored in the "files" directory. In order to see the ...
0
votes
1answer
344 views

file field properties drupal7

I'm building a library and it is possible to add books to website. I need to get uploaded file urls and display them in 'a' tag inside views page (not node). how can I do that? unfortunately I can't ...
0
votes
2answers
2k views

How do I get file ID from node?

How can I get file ID like I got, for instance, file URI: $getFile = $entity->get('field_file')->entity->getFileUri(); I need it to send an email (swiftmailer) $file_one = file_load(1);
0
votes
1answer
370 views

Save a managed file with cURL

I want to save a managed file from an external site. Previously, I've used this code: $managed = TRUE; // Whether or not to create a Drupal file record $image_file = system_retrieve_file($product['...
0
votes
1answer
100 views

Student TV channel - taxonomising YouTube videos

This question has been created to break up a previous question; see there for more detail. As you can guess from the title, I'm the new webmaster for a student TV channel and I need to update the ...