Download & Extend

Need to manipulate file metadata upon uploading from a cck form

Project:FileField
Version:6.x-3.1
Component:Code
Category:support request
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hi

I have a cck form in which there is a filefield for uploading any type of document file(doc, pdf, ppt, odt).

Now, I have to convert each kind of file to pdf file. i.e. when user click on submit, I want to process the file information before saving to db.

But, the problem is, I'm not able to find a place where I can put the code. I tried 'field_file_save($node, &$file) {', but upon changing I found that nothing changed in db. I checked my code, it worked fine. But, the information I put in $file data structure, is not being saved by DB.

Please help me.

Comments

#1

Status:active» closed (fixed)

Sounds like you were on the right track. You need to use hook_file_save() in your own module, but you can't modify the data in the $file object and have it saved automatically, you need to actually write your data to your own database table manually. See the filefield_meta module for an example of how to do this. Support for writing custom code however is not provided in the FileField queue, so I'm closing this issue.

nobody click here