All Questions
67 questions
1
vote
1
answer
285
views
How to add an extra field in file upload widget?
I know that it is possible to enable a description field in the core file upload widget for Drupal 7.
However, I want to add an extra description field like the one already present. For this I've ...
2
votes
2
answers
2k
views
Server Configuration causes file uploads to fail
I have a drupal 7 site running on a Redhat shared hosting environment that uses zend php. I am having problems with file upload on content types and webforms that accepts various file types up to ...
0
votes
0
answers
43
views
Adding file description field to already existing records
I have a site with various hundreds of a particular content type. This content type contains a field of type file. We have decided we want to display a description rather than the filename. I have ...
2
votes
0
answers
35
views
Add file path to entity programmatically [duplicate]
I am creating an entity programatically, I want to set a file in entity, I have tried following method.
$file_path = '/sites/default/files/abc123.pdf';
$values = array(
'type' => 'review',
...
1
vote
1
answer
391
views
How do I attach a file to a file field when saving (update/insert) a node?
After creating programmatically a PDF file with TCPDF, I am trying to attach it to my field "file_fichier", here is what my code looks like
/**
* Implements hook_node_presave().
*/
function ...
0
votes
1
answer
170
views
How to Create a Table of PDFs with Views?
I've been tasked to develop my company's intranet with Drupal. One of the key items is to allow our HR department to upload job openings (PDF's) to display on site. I'm envisioning having this table ...
1
vote
1
answer
59
views
Display text according to the access to a field
With field permissions, I restrict the access of a field to certain users.
I would like to display some text to inform the user that he has no access to the field.
I tried it in node.tpl.php :
&...
0
votes
2
answers
52
views
Show page content on another page using views
I have a 'presentation' page where I would like an image gallery where all the uploaded images that users upload to the site are displayed.
So far these images are being displayed only on the 'upload'...
1
vote
2
answers
524
views
Warning: Invalid argument supplied for foreach() in taxonomy_field_formatter_view()
My Drupal installation has some warnings, I tried several patches, but none of them works for me. These are the warning messages:
Warning: Invalid argument supplied for foreach() in ...
0
votes
2
answers
74
views
file_usage_add issue for compound field
I have created a custom compound field which contains a managed_file element in the field widget form.
The issue I am having is not with saving the file, but with adding the file usage information.
...
2
votes
2
answers
375
views
How to disable access to file page (view display mode = full)?
I want to disable access to the view display page of file by url like file/fid.
What's the good way for this? I have tried to use the hook_node_view() but it not called for the files.
2
votes
0
answers
295
views
Video Embed Field module - how do I add attribute 'id' to the embed youtube iframe?
The question is related to DRUPAL modules name is 'Video Embed Field' module.
The default output of this module generated the Youtube iframe embed as set in the config by Administrator. But...
The ...
0
votes
1
answer
70
views
EntityStructureWrapper for file field is not being inflated properly while iterating
While trying to interate over file filed values, EMW cannot being created properly. using isset() for not iniated fields and then trying to set them is not helping.
I get the error:
...
0
votes
3
answers
3k
views
attach an programmatically generated pdf file to a node
Im using PDF Using MPDF module to generate 4 files when a node is saved using its API function pdf_using_mpdf_api:
function MYMODULE_node_insert($node){
// PDF generation :
// ...
1
vote
0
answers
59
views
YouTube media filed without remove media button
I'm using Drupal 7. The Remove media button on youTube media entry (field) is missing. This is for a field with name: Videos, field type: Multimedia asset (deprecated), widget: Media file selector.
...
2
votes
1
answer
2k
views
Plupload widget type not appearing
This is what I've done so far:
Installed & enabled the Plupload integration module in my drupal website (version 7.x-1.7)
Added Plupload library to my libraries directory (version 1.5.8)
In my ...
2
votes
1
answer
632
views
Rendering a generic file field containing an image
Drupal 7.34
Media 7.x-1.4
Views 7.x-3.8
I have a generic file field. Sometimes the uploaded file is an image, and in these cases I want to render it in a View as a thumbnail.
So I do the following:
...
0
votes
2
answers
149
views
Download file field dependent on user role vs role field values
I have a type downloadable_item which has a field field_roles_allowed that is based on the Role Field Module.
My goal is to have a field_download of file type that will show the file for download if ...
1
vote
2
answers
531
views
Change values of nested fields with entity_metadata_wrapper
The background of this question is that I'm trying to migrate data from Drupal 6 Imagefield Extended to Drupal 7 File Entity (with File Entity Inline). See also https://www.drupal.org/node/974888
...
0
votes
1
answer
818
views
Drag & drop upload plugin, how to make it multiple
I am trying to use this module to upload multiple files into a schemma that I created (in a separated module),
https://www.drupal.org/project/dragndrop_upload
$form['file'] = array (
'#type' => '...
1
vote
1
answer
1k
views
How to get a remote file and set it as a value for a file field using entity metadata wrappers?
I am trying to get a remote pdf file from a web service and save it as a field's value using entity_metadata_wrapper, but somehow I couldn't get it working.
I can successfully retrieve the file using ...
2
votes
1
answer
812
views
Attaching file to node field
I have a problem. I'm trying to attach file to node field by this code
function calculator_page_form_validate($form, &$form_state) {
$file = file_save_upload('file', array(
// Validate ...
1
vote
1
answer
1k
views
How to migrate fields attached to files?
I'm writing a file migration using migrate/migrate_d2d to migrate files from one Drupal 7 installation to another.
Images have custom fields attached to them, including a text field "...
2
votes
3
answers
3k
views
How do I extract filename and filepath from a file field?
Here is what I am trying to tackle: I would like to allow a zip file to be uploaded via the default filefield upload widget for a content type. I am using hook_node_presave to take the zip file and ...
0
votes
0
answers
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 ...
4
votes
2
answers
4k
views
Template suggestions for file_entity.tpl.php
Short version
My aim is to theme a file field in a view of node fields. In the view configuration, the field formatter is set to Rendered file and a view mode is selected. How do I suggest a template ...
0
votes
1
answer
1k
views
Creation of entity with image field
I would like to generate an entity that contains image generated by another module file in drupal 7. This is my code :
//appel de la variable user
global $user;
//recuperation de lapercu
$apercu = $...
0
votes
1
answer
597
views
Add widget to file field
I am looking to write a field widget to extend the file field in Drupal 7. The reason is that I want to do some file parsing after it has been uploaded. Are there examples I would be able to look at? ...
0
votes
4
answers
2k
views
How to use a block as a field?
I'm working with this module which is providing me a block for uploading the file as mentioned in the doc https://drupal.org/project/jquery_file_upload
Is there a way, where I can use this block as a ...
1
vote
2
answers
3k
views
How to make an uploaded video visible on the node page in drupal 7
I have created a CCK named sample with a field name VIDEOS of type file. I have added a video of CCK type Sample. But it only showed a url after the node is saved.
Instead of displaying the file ...
2
votes
2
answers
1k
views
How can I set-up a custom formatter that uses target="_blank"?
I've installed the Custom Formatters module, as I could not figure out why my View setting was not working for "Rewrite output" -> "Target" -> "_blank"
I need to recreate either the "Generic File" ...
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 ...
24
votes
5
answers
19k
views
How to set value of file field with entity_metadata_wrapper
How do you set the value of a file field when using the entity_metadata_wrapper?
I've tried doing this in code:
$file = new stdClass();
$file->uid = 1;
$file->uri = $file_path;
$file->...
1
vote
1
answer
1k
views
How to programmatically set a file field to allow multiple uploads/values?
I have created a file field with field_create_field() and added an instance of it to my custom node type with field_create_instance() in my module's hook_install()function. But how do I set it to ...
3
votes
1
answer
75
views
How to store field data in a file instead of the db?
So far, I found two decent options for storing field in a file:
using node hooks to store data in a filefield, and process it on node view
theoretically, the best would be to use file storage as a ...
0
votes
0
answers
84
views
All File Descriptions from Multiple Value Field Showing Up for Each File in Views
I hit a little snag setting up this View for uploaded documents. I use a multi-uploader field to upload two files to an Entity. I've added descriptions for each file. When I try and display this in ...
1
vote
1
answer
288
views
Deleting nodes makes orphan records
I have a content type "event" which has an image field.
I tried to deleted the nodes, but I got the repeated errors when deleted the nodes.
Warning: array_flip(): Can only flip STRING and ...
2
votes
0
answers
151
views
Taxonomy based file path for imce
I've added the field "field_sdb_profile_basics_forv" to my (default) drupal user profile.
Now I need the IMCE editor to detect and choose the file path, based on that field specifically.
As pr ...
1
vote
1
answer
80
views
How to remove files using File widget
After clicking on the "Remove" button, the entry disappears, but the file is still on the server.
1
vote
2
answers
836
views
Hide Alt and Title for image field
How to hide Alt and Title fields for anonymus users when they upload images? I use tokens for these field that's why I need to hide them.
4
votes
2
answers
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, ...
3
votes
2
answers
2k
views
Storing images as nodes
I am building a Drupal 7 platform where users can share images. In a nutshell, people should be able to comment on images and like them.
The way I realized this is by creating a custom content type ...
0
votes
2
answers
326
views
Adding a "title" field to video thumbnails in the Video Module
I would like to attach a textfield field to the video field. How can I go about doing that programmatically?
How do you attach a field of a field?
0
votes
1
answer
103
views
How to create file field instance that allow teaser and full description and not allowed extensions but denied extensions?
I need to change the default Drupal functionality of file field:
I want to be able to allow upload of all files types, EXCEPT the extensions listed (reversing the current funcitonality)
I also want ...
0
votes
1
answer
2k
views
Is there a hook or sth after file is uploaded via file field?
I have drupal 7 installation with file field + video field(and media module). I can change where to upload files in video field setting(default: videos/original).
I'm trying to do stuff to videos ...
0
votes
3
answers
5k
views
How to add a field widget for multiple file upload?
Is there a module that provides a multiple file upload (Drag and Drop) widget? If there isn't, how can I build one? Will it require a special setup for the server stack (LAMP)?
1
vote
2
answers
1k
views
How do I migrate CCK filefield?
I'm migrating a Drupal 6 site with CCK filefields to Drupal 7. I installed the Drupal 7 CCK module, and I'm ready to do the migration except for a filefield field.
Migrate fields states:
Missing ...
0
votes
3
answers
1k
views
Accessing the cell phone camera to populate the profile picture field [closed]
I have a mobile website, and I thought it would be cool if there were a way for the user to take a picture with their phones camera to populate the field rather than have them go and upload a picture ...
0
votes
2
answers
5k
views
PDF file open new tab
I'm using Drupal 7. My theme Omega. And have got file field in my site. Uploaded all pdf files and everything working.
But, when i click pdf files on Firefox, my pdf file starting download. When i ...
5
votes
1
answer
2k
views
In Drupal 7, how do I create a custom rules event for any and all file entities?
I'm having trouble creating a small module to add an Event scenario to Rules using the Rules API. Basically, I'm creating a rule that should detect to see if certain fields of a file entity have ...