Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
41 votes
1 answer
19k views

Managed file: the file used in the field may not be referenced

I am having some issues with the managed_file type. Whenever I try to edit and save a form that has a managed_file element in it an error occurs: The file used in the Picture field may not be ...
Bart's user avatar
  • 6,944
10 votes
3 answers
21k views

Image Upload in a Custom Module

I'm writing a custom module, and I need it to upload an image. I'm having trouble finding good documentation on this, but I think I'm close. What am I missing? $file returns false in the form ...
Tim's user avatar
  • 203
7 votes
3 answers
7k views

File save upload doesn't replace existing file despite FILE_EXISTS_REPLACE

I'm trying to force replacement of existing file with same name, if a new version is uploaded by user. I've seen a lot of posts about this topic but none that I could find addresses how to force the ...
longboardnode's user avatar
5 votes
2 answers
11k views

File upload with ajax

Is there any example how to set up form element with type file to upload it via AJAX. I want to be same as field image in node type article. thx
kkatusic's user avatar
3 votes
3 answers
4k views

Drupal 7, form api - file field default_value

I've created a formular where the user can upload an image using a file field. In another formular the user is able to change the image he previous uploaded. So far I was able that the user can ...
FeBe's user avatar
  • 303
1 vote
2 answers
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 ...
geerlingguy's user avatar
  • 5,483
0 votes
3 answers
3k 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 ...
longboardnode's user avatar