Content Management and Capture

Content Management and Capture

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
Expand all | Collapse all

Viewer Plugin - how to know file size

  • 1.  Viewer Plugin - how to know file size

    Posted Thu August 20, 2020 08:31 AM

    Hi

    We are using ICN 3.0.7 and I successfully wrote and deployed a viewer plugin. The repository is CMOD. In our viewer we would like to download the document to memory instead of to a file. For that it would be practical to know the file size to allocate the correct memory buffer size.

    My original idea was to do this via odwek in the viewer plugin but unfortunately it seems that in the execute method we are not being given a repository id and thus I can not connect to the OD server. Is there a way to determine the file size of what the docURL points to?

    Alternatively I thought I could implement a custom open action but I am getting a little intimidated by the JS stuff that needs to be done for that and the lack of good resources.

    Thanks in advance



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 2.  RE: Viewer Plugin - how to know file size
    Best Answer

    Posted Thu August 20, 2020 09:10 AM

    Hi,

    Maybe you can first to use ICN's getDocument action to retrieve the document first. Then check the 'Content-Length' in the response header to get an approximate file size.

    Thanks,

    Jason



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 3.  RE: Viewer Plugin - how to know file size
    Best Answer

    Posted Thu August 20, 2020 09:26 AM

    Hi Jason. Many thanks. Such a simple solution. I can even do this in my viewer. Thanks again. Thomas



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration