Adding a new file to an existing object (javascript)

Hi,

I succeeded to update an existing file attached to an object via the API "REST/objects/0/{checkedOutObjectVersion.ObjVer.ID}/files/{checkedOutObjectVersion.Files[0].ID}/content.aspx?_method=PUT", although that was tough. I need now to add a new file to an existing object. From the C# example at https://developer.m-files.com/APIs/REST-API/Updating-Objects/#updating-an-existing-file, I figured out that the API is "REST/objects/0/{checkedOutObjectVersion.ObjVer.ID}/{checkedOutObjectVersion.ObjVer.Version}/files/upload.aspx". However, it is not clear at all how I pass the file name and file extension through the API, mostly since I am using an application/octet-stream content type where I cannot mix JSON data and binary data.

Any help would be appreciated, as well as javascript examples.

Thank you in advance,

Gilles Gerlinger

Parents Reply Children
No Data