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

markus_petrux’s picture

Component: CCK in core » General
Category: task » support
Priority: Critical » Normal
Status: Active » Fixed

I'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.

gorav.singal’s picture

Status: Fixed » Active

Thanks 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.

markus_petrux’s picture

Status: Active » Fixed

Yours 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.