The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
11 views

Adding accept attribute to managed_file field to specify file types client-side

I've got a file field in a custom form like this: $form['image_upload'] = array( '#type' => 'managed_file', '#title' => t('Image upload'), '#description' => t('Upload png ...
1
vote
2answers
12 views

How might I have Webforms save files to private file system or as a database blob?

In Drupal 7, I have the file system configured as In the code for the Webforms' file component located at sites/all/modules/webform/components/file.inc, it appears that one could easily change it ...
0
votes
0answers
14 views

Is there any core or module functionality that automatically corrects URLs in node content bodies?

Background I'm investigating some odd behaviour on a Drupal 7 website. We're using the upload replace module to turn Drupal's file versioning on its head. However, there's a bug with this module ...
0
votes
0answers
27 views

How to debug missing form field?

My content type has a field_file (managed file). Problem is that the file is only visible to person who uploaded it. I upload the file as UID 1 and can't see it as normal admin. The field is there in ...
0
votes
0answers
20 views

Problem in theme-settings trying to save and modify file drupal 7

I have downloaded a template and what i want to achieve is that i can upload a file from the template option without using the ftp client. I have three slideshows and the code that i have implemented ...
0
votes
0answers
15 views

How to change file field destination

i'm using Drupal 7 and have an article content type with a file field for article pdfs (field_pdf_file). Currently this field points to the Drupal 7 private file system so uses the stream private:// . ...
0
votes
0answers
45 views

Replace the file with same name

With reference to post for the validation function in managed_file field, but i am facing an issue with file_desitination() $file->destination = ...
0
votes
0answers
21 views

Temp images still aren't being saved in custom module form

I have what appears to be an expected issue with Drupal 7 in my custom module. My temp images are removed every few hours when the system_cron() function runs. I am, however, using a form submit ...
1
vote
0answers
62 views

Why does managed_file not respect the #upload_location?

I've got a managed_file, with an #upload_location set to 'public://uploads'. When I upload files using the managed_file form element, uploaded files get copied to the 'public://' root, but not the ...
0
votes
0answers
23 views

Disable transfer file (managed_file) until form is validated correctly

How to disable transfer file from custom form to server (managed_file) until form is validated correctly i have 10 required fields on form and 1 more field is: $form['picture_upload'] = array( ...
0
votes
0answers
26 views

custom entity admin page integrity constraints violation of managed_file in 'remove' process

I am developing a custom entity administrative page. The custom entity makes use of managed files. This is by storing a foreign key of file_id that references the file id in "file_managed" table. ...
0
votes
0answers
72 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 ...
0
votes
0answers
21 views

Print out multiple upload fields on a page

I'm trying to output 4 upload fields on a page. But the problem is that it only outputs the first one and not the rest. All works fine when uploading the files with Drupal's form api, but I just can't ...
2
votes
1answer
1k views

How to attach Dropzone.js uploads to a form element

I'm integrating dropzone.js into my form, but I have an issue regarding my file uploads. I have my dropzone set up, and file uploads are in the $_FILES array. I want to call file_save_upload to ...
0
votes
2answers
140 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
1answer
81 views

Programmatically add PDF file to user

So using the 'file' module i have added a field to the user table called 'user_files'. What i want to know if how can i programmatically add a file to the user, so that it is displayed on the users ...
0
votes
0answers
351 views

How to change 'upload' and 'choose file' text that generates form type managed_file

$form['cv'] = array( '#type' => 'managed_file', '#title' => t('Vaš CV'), '#default_value' => '', '#progress_message' => t('Molimo Vas sačekajte...'), ...
0
votes
0answers
44 views

Form submit function not called when using managed file field

I have a bunch of custom module forms that has been working for a number of months. Yesterday I started to play around with a whole bunch of modules and file settings that were related to files but I ...
1
vote
1answer
64 views

How to load file, when I know it's filename, but not fid?

I create filenames using some ID and timestamps. I don't want to add additional table to "remember" associations, as filename keeps them pretty well: $filename = get_symbol_by_id($id) . ' ' . ...
0
votes
1answer
362 views

Is there any File Manager Module for drupal 7

I need a module as like as File manager. we need to view, edit, modify and delete the files and also with permission option. Thanks,
0
votes
2answers
341 views

How to Remove '-None-' option from Select List Field?

How can I remove the default option -None- in the Select list? It should not be an option in my select list.
0
votes
1answer
219 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 ...
1
vote
2answers
2k views

How to save file uploaded with plupload integration module, and make it managed?

As described here, I can use Plupload integration module to upload my files to server. They go there, I can see them in temp directory, and that's the point I'm stuck. Code I'm using for a field is: ...
1
vote
1answer
45 views

Categorised Multiple File uploads within a page in Drupal 7

I have a situation where I have to upload multiple files within categories. This can be explained by the following picture. As you can see I need to upload multiple files, but also need to categorize ...
0
votes
1answer
23 views

On export Managed_files With Features No UUID Added

I have a custom field of type 'managed_file' along another field of type - 'file'. This node is exported into feature. The field with 'file' type gets UUID attached while it does not for ...
0
votes
0answers
52 views

Unable to save audio file to node in drupal 7

I am attaching an audio file to node using services 3 in drupal 7. When I hit my URL: www.mysite/api/nid/attach_file I get an error: STATUS 500 Internal Server Error: An error occurred (23000): ...
0
votes
0answers
292 views

file_managed table cleanup after replacing content

We have an issue where if we replace content pages on our Drupal site, the files referenced in the content page remain in the database. When we go to recreate the content page, Drupal starts throwing ...
0
votes
1answer
369 views

Setting managed file default value from ajax request

I'm trying to create a form using the Form API with the following behavior: For a custom slider module, users can choose to upload an image which is saved as a managed file. This works fine. They ...
0
votes
0answers
51 views

Unable to save private files

I have the same question as is discussed here: Problem setting a private directory but no solution is provided... If I set-up a private directory in config/media/file-system, even if it is the ...
0
votes
1answer
75 views

Set node field value in separate form

I have a File field attached to my content type. Using Drupal, when we are creating new node, we use node form to set all field values for particular node. But is it possible to create more forms for ...
1
vote
0answers
46 views

How to properly duplicate image for “clone” form? [duplicate]

I have a form for cloning entries. Basically it works the same way as entry add form, it saves under brand new ID, but is pre-filled with data from existing entry. For data like text and references, ...
0
votes
1answer
211 views

From API - Managed File: Remove Button not working

I'm using a "managed file" to upload an image, which works fine, but if you want to remove the image by clicking on the "remove" button, nothing happens. $form['logo'] = array( '#type' => ...
0
votes
1answer
113 views

Parse managed file

I am very new to Drupal 7 module development and I have been working to develop a module where it parses a file after the user uploads it. I am using hook_forms, but for some reason I can't get a ...
1
vote
0answers
19 views

What is going on with this exposed operator on my view of files?

What I did: Edited a View of Files Added File:usage:entity ID as a filter Exposed the filter Exposed the operator Selected an option and applied it. I see these weird empty boxes appear below the ...
0
votes
0answers
41 views

File usage as views filter?

I'm overriding the Workbench default view of files, and trying to add a filter to let the user optionally show all files that have no usage on nodes. I see that there are ways to filter and show file ...
1
vote
1answer
32 views

From managed file ID to end-user link - neat and clean way?

I have a structure in database, and I want it printed. So in hook menu I have entry with 'page callback' => 'mymodule_mystructure_display', And in inc file I have function ...
1
vote
1answer
17 views

Page where I can see my user's managed files

Is there a page in Drupal that lists all of the files in file_managed that the logged in user owns?
0
votes
2answers
1k views

7: Form API: managed_file: AJAX upload error “Undefined index … in file_ajax_upload()”

I have a problem with "AJAX: add more file fields". The Problem: i create new managed_file field and add AJAX function "add more file fields". When i try to upload a file with first static file field, ...
1
vote
1answer
133 views

file_save_data fails in CLI

I'm trying to create a file attachment in a Drupal content node from a command line script. When I'm calling file_save_data(), passing a public://something URL as destination, it fails. I've tracked ...
0
votes
1answer
59 views

Private File System and Externally Modified Files

I have a D7 site that includes a few hundred nodes that have PDF attachments that use the core file field and the private file system. The site uses a custom module to dynamically watermark these PDFs ...
0
votes
1answer
90 views

How to fetch the existing value of a form field in the form?

I have a minimal form with a single field to add an image to an entity and a save button. I have used managed_file to add the image. After adding the image from form the image gets saved in db. Next ...
0
votes
1answer
62 views

How to duplicate image file in the same folder

i want to duplicate a image file in the same folder programmatically , so i'm used file_copy() function for this but the original file image replaced or renamed and in file_managed table on database ...
1
vote
1answer
88 views

How to get the URL for the re sized image

I have built a custom form in Drupal 7. The form has a file type field which allows the user to upload an image. I'm using the below code in the submit function to save and re size the image: ...
0
votes
2answers
617 views

File upload with title

I want functionality where editor will be able to upload files and name that files whatever he wants, I just want additional field next to file upload field, is there any module which can do that? ...
-1
votes
1answer
167 views

How to show the uploaded managed_file in the edit page?

I am able to successfully upload files using managed_file. The file is saved in the correct directory and the record shows up in the file_managed table. $form['image'] = array( '#title' => ...
0
votes
2answers
204 views

Notice: Undefined index: #value in element_validate_integer_positive()

I'm getting the error Notice: Undefined index: #value in element_validate_integer_positive() (line 4190 of includes\form.inc) after clicking the Upload or Remove of a managed_file even though the file ...
1
vote
1answer
505 views

Does Multiupload Filefield Widget for Drupal provides a Form API element?

I have a form in on of my Drupal page that uses Multiupload Filefield Widget to upload multiple images at once. I want to alter the functionality of this Multiupload Filefield Widget from my custom ...
0
votes
1answer
191 views

How to submit form on selecting image in file select widget?

I am using Drupal Form API to upload profile image for user. I found two file upload widgets in FORM API: '#type' => 'managed_file' & '#type' => 'file' managed_file requires first ...
3
votes
1answer
384 views

File Upload, overwriting every time

I am using the Migrate module, and I need to upload a CSV file before every migration run. I've created a module that allows me to upload a file. My first step was to make sure I had the logic ...
-1
votes
2answers
833 views

get path of an uploaded file

This is my form to upload a photo $form['Background_image'] = array( '#type' => 'managed_file', '#title' => t('Choose a background image'), '#description' => t('Click "Browse..." to ...