How can I change the format of the primary rendition through IAPI?
Chatgpt tells me to destroy the primary rendition but as far as I know, this is not permitted.
If there are Accepted Answers, those will be shown by default. You can switch to 'All Replies' by selecting the tab below.
Then you just need to change the a_content_type attribute for the object
Or setfile,c,0901ece38255f410,E:\converted\0901ece38255f410.pdf,pdf and drop the following command
when you say change the format, do you mean the a_content_type of the object or do you mean the file itself, with another format?
I mean replacing the jpg file with a pdf file. Checkout/Checkin doesn't work with a different format it seems.
Check in from file should. What client are you using?
If D2, you might need to check with the admin if the option is not configured out.
I mean through IAPI. There is no file location parameter for checkin. There is one for setfile but then how do I change the format for that primary rendition?
You need to issue setfile command with the new file path and the new format. And then you can checkin (if you checked out before) or save (if you didn't checkout).
Thanks both Hicham Bahi and François Dauberlieu. This works.
API> fetch,c,0901ece38255f410 ... OK API> setfile,c,0901ece38255f410,E:\converted\0901ece38255f410.pdf ... OK API> set,c,l,a_content_type SET> pdf ... OK API> save,c,l ...
You can also do this in client UIs
D2Classic/SmartView - Import New Version, navigate to the file you want to replace with (any format) and it will check it in
DA/Webtop - Checkin from file, choose the new file.
Not really an answer to your question, just an expansion on the options to do the same via an existing client UI in case it is useful 😃