Maybe not. But I think you could work around that with some sort of AHAH trickery or popup that performs the upload and inserts the file name into your form field? I would examine the core Upload module to see how it's done.
Nice ! I could not figure out why it didn't work. The form built in case 'configure': can't be given special properties like #attributes. Those properties need to be added with form_alter, as mikemiles86 mentioned. Then it works like a charm. Thanks !
Comments
Maybe not. But I think you
Maybe not. But I think you could work around that with some sort of AHAH trickery or popup that performs the upload and inserts the file name into your form field? I would examine the core Upload module to see how it's done.
yes, its possible
hi,
yes , its possible to add file upload in block configration module.
But for this you need to know some basics of coding.
Steps
1- Enable the block module for file upload. i.e. add the multipart/form-data attribute in form in configure page
For this add line
in block_admin_configure in block.admin.inc in block module.(You will find it in site/Module/block)
2-now just add file upload button in block configure page and go. :)
open your block module and search for the line
(check this line is already present or not)
3-for saving the file check the line
in same function in your block and add file upload code there
:)
no need to
You don't need to alter core. You can alter the form using the hook_form_alter() in your module, like so:
- Michael Miles
File upload in block configuration
Nice ! I could not figure out why it didn't work. The form built in
case 'configure':can't be given special properties like #attributes. Those properties need to be added with form_alter, as mikemiles86 mentioned. Then it works like a charm. Thanks !Four Kitchens has a tutorial
Four Kitchens has a tutorial that explains this very well. I used it this morning.
https://www.fourkitchens.com/blog/article/building-custom-blocks-drupal-7/