<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">upload.module has the code you'll need to study--specifically,<br>
upload_nodeapi and upload_save.</blockquote><div><br>Note also that when you delete the original node, the original files attached to the cloned node will be deleted as well.<br><br>There is work to assign files to user instead of nodes, and afaik this would solve the problem
<br><br>Philippe<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br>Note that saving file associations is limited by a permission.
<br><br>The key question to consider is, what does upload do with a *new* node? In<br>this case, any files associated with a node are those that were just<br>uploaded.<br><br> // New file upload<br> elseif (strpos($file->fid, 'upload') !== FALSE) {
<br><br>This won't help you, as your files array doesn't contain this marker.<br><br>Consider instead:<br><br>elseif ($node->old_vid && is_numeric($fid)) {<br><br>You could consider tricking upload.module
into doing the handling by setting<br>an old_vid. Or else just write your own handling based on upload_save.<br><br></blockquote></div><br>