Skip to main content
Question

Export a bunch of documents with their original file names


Forum|alt.badge.img+3
  • Do Gooder (Customer)
  • 5 replies

I have added a bunch of documents to a selection (in Document Revisions). I may select one document and right click on it and select File Operations > Copy File To… and in the popup window Name Files Using… I may choose Original File Name (instead of Document Title and Name).

But when I select more than one document I don’t get the possibility to choose the original file names. The documents are all saved with IFS generated file names.

Would it be possible to, in one way or another, bulk export the documents with their original file names? If I am going to export ~50 documents it’s a time consuming process to export them each and each or rename them afterwards. They have to have their original filenames to match the names in another system.

4 replies

eqbstal
Superhero (Partner)
Forum|alt.badge.img+21
  • Superhero (Partner)
  • 672 replies
  • May 30, 2020

I would say that a post of me with an alternative to another question might be helpful here as well:

https://community.ifs.com/people-all-about-your-employees-38/document-attachments-1806?postid=7438#post7438

The trick here would be to derive the correct x (50 in this post) documents. Maybe an entry point can be documents in a specific document folder (standard functionality in IFS) or all the document numbers in a conversion list (part of basic data of Data Migration).

Steve


dsj
Superhero (Partner)
Forum|alt.badge.img+22
  • Superhero (Partner)
  • 836 replies
  • June 1, 2020

Hi @henfri ,

 

There are set of methods in batch_transfer_handler_api to download set of documents from IFS Document repository to a shared file location.

 

Below script will do the work for you :)

change the where condition to filter your documents.

Here, F:\fileshare\temp\ is a folder located in IFS Middleware Server. If you are need to download file to a shared folder, make sure IFS middleware server has full access to that location.

-- Created on 2019-07-03 by DSJ
declare
  -- Local variables here
  error_msg_ VARCHAR2(32000);

  file_name_ varchar2(32000);

  CURSOR get_rec is
    SELECT * FROM edm_file_storage where doc_class = '109';

begin
  -- Test statements here
  FOR rec_ IN get_rec LOOP

    file_name_ := edm_file_api.get_file_name(rec_.doc_class,
                                             rec_.doc_no,
                                             rec_.doc_sheet,
                                             rec_.doc_rev,
                                             rec_.doc_type);

    batch_transfer_handler_api.download_from_db(error_msg_,
                                                rec_.doc_class,
                                                rec_.doc_no,
                                                rec_.doc_sheet,
                                                rec_.doc_rev,
                                                rec_.doc_type,
                                                rec_.file_no,
                                                'F:\fileshare\temp\' || file_name_);

    IF error_msg_ IS NULL THEN
      dbms_output.put_line('success');
    ELSE
      dbms_output.put_line(error_msg_);
    END IF;

  END LOOP;
  commit;
end;

 

Cheers!


Forum|alt.badge.img+12
  • Hero (Employee)
  • 124 replies
  • June 2, 2020

If it is a one time thing, you can also use Windows Powershell, Navigate to the folder and use the following command to delete the “Copy of” Part.

Dir | Rename-Item -NewName {$_.name -replace "Copy of ",""}

If you have a text behind the document, you can also use the following command to remove the last part of a document name (in this case the last 32 characters)

Dir | Rename-Item -NewName {$_.name.substring(0,$_.BaseName.length-32) + $_.Extension}

 

 


Forum|alt.badge.img+3
  • Author
  • Do Gooder (Customer)
  • 5 replies
  • June 12, 2020

Thanks for your answers! However, I had hoped to get a more simple solution, like click on that menu option and you are done or ask you administrator to adjust a setting in the IFS configuration.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings