I have a content type that contains a file field which is always a .zip file. When a file is uploaded I have a module that unzips the file to make a few changes then re zips the file to a new location. I would like to associate this newly created .zip file with my content type but so far I have not been able to find a way to do that. I initially tried to change the url of the file field in which it worked temporarily but it seems that the file field was later re-saved with the initial value.
I do my unzipping and re-zipped from hook_node_presave (I also tried to do from hook_node_insert) but neither seemed to work. Could anyone offer me any advice about how to change the file of a file field?