Add existing file to different object

I have a lot of files that are already in M-Files and attached to documents, and I want to attach them to a different object type as well. Is it possible to do this with the REST API?

Parents Reply
  • Ahh, I understand. 

    So two points to my answer. 

    Firstly: you can do this, but you effectively have to download the file then re-upload it. So get the file content, then upload it again as per this sample. 

    Secondly: you should probably not do this. One primary point of M-Files is to try to avoid duplication, and copying the files sounds like you should change the process. Instead what you probably want to do is create an object and _relate_ it to the other item. You do this by creating an appropriate property on the new item and set the lookup to point to the original file.

    There _are_ some reasons to copy a file at a point in time (e.g. when creating a "published" version of a source document), but they are generally the exception rather than the rule. 

Children
No Data