Move file to specific folder after upload in forum I am using Drupal 7 with Organic Group and Forum Module.

I have added facility to attach files in Forum posts. Now after forum(node) is submitted, I would like to move the file (which is with forum node) to specific folder.

Actually I would like to move/copy to other folder during node submit only, is is possible with hook_node_submit()
Here is how I implemented it using hook_node_insert() function.

function modulealter_node_insert($node) {
    // See if a file has been added
    if ($file_items = field_get_items('node', $node, 'field_file_attachment')) {
        // Get the first file item
        $file_item = array_shift($file_items);

        // Load the file object from the cache/database
        $file = file_load($file_item['fid']);

        // The path to the file is in $file-&gt;uri
        //var_dump($node-&gt;group_audience['und']['0']['gid']);


        //Set the destination folder where do you want to move it
        $destination = "private://filedepot/filedepot/test/".$file-&gt;filename;
        $file = file_copy($file, $destination, FILE_EXISTS_REPLACE);
    }
}