Drupal: get "source" information when uploading file
===

I'm googling around since 3-4 hours but I give it up now.
I have a module which creates custom node types at installation. I have content type called "Paper" and it has a file field.
What I would like to do is to handle the file uploading (I have to make some computing on it) but only if the file comes from this kind of content type.
There is a hook hook_file_insert, but in the parameter it only gives me information about the file itself, but I need to know "where" does the file comes from, to which form/node it belongs to, so I want to see that a file comes from a Paper upload.

By the way I checked the data which is sended by the AJAX file upload and that AJAX call contains the whole form as well as the form id, so the information is sent to the server, but I don't know what function or hook should I call to extract it.

Thanks in advance for any help!

Cheers,
kojak