Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
6.x-2.4
Component:
General
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 Nov 2009 at 10:53 UTC
Updated:
18 Nov 2009 at 10:20 UTC
Hi
I have a cck form - Title(textfield), 2 filefield.
I want to display Title field & 1 filefield. I can do this by theming cck form.
Filefield can have any type of document(pdf, doc, ppt, odp). Now, when user click on submit button, I want to convert uploaded file(X) into Y using some converter tool. I want to save uploaded file in Filefield-1 as it is, and converted file in the FIlefield-2.
My question is Where to put this code i.e. after submit??
Comments
Comment #1
markus_petrux commentedI'm not sure if there's some kind of hook related to FileField to do this (you may want to ask in the FileField queue), but still, you should be able to do whatever you need using either a submit handler attached to the form (consult Form API documentation), or hook_nodeapi(). See api.drupal.org for references.
Comment #2
gorav.singal commentedThanks for replying.
OK, please suggest me a place or function where I can put my custom function to change one field of form posted. And, after processing, I want to pass the form to normal submit routine.
Comment #3
markus_petrux commentedYours is not a CCK question, but something related to how Drupal works.
To get you started, you probably need to create a custom module, and here you can implement hook_form_alter() to inject a submit callback, or you may need to do that task implementing nodeapi(). There is more than one way to do things in Drupal, and it depends on your particular use case.
To resolve your doubts now, someone would have to work hand in hand with you, I think, or you need to learn how Drupal works. Please, read the handbooks, and consult api.drupal.org. You may also try asking in the development forums.