IAPI command - change format

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.

Best Answers

  • Francois Dauberlieu
    #2 Answer ✓

    Then you just need to change the a_content_type attribute for the object

  • Hicham Bahi
    Hicham Bahi E Member
    #3 Answer ✓

    Or setfile,c,0901ece38255f410,E:\converted\0901ece38255f410.pdf,pdf and drop the following command

Answers

  • 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?

  • A B
    A B Member

    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.

  • A B
    A B Member

    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?

  • Francois Dauberlieu
    #8 Answer ✓

    Then you just need to change the a_content_type attribute for the object

  • 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).

  • A B
    A B Member

    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
    ...

  • Hicham Bahi
    Hicham Bahi E Member
    #11 Answer ✓

    Or setfile,c,0901ece38255f410,E:\converted\0901ece38255f410.pdf,pdf and drop the following command

  • Michael McCollough
    Michael McCollough E Community Moderator

    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 😃