Skip to main content
Solved

Retrieving EDM File Data in Azure File Storage through PLSQL


Forum|alt.badge.img+12

Hey,

I am looking for whether an existing PLSQL Package exists with a method that’d help me in the following case:

In an IFS Cloud Install, IFS Managed Cloud Deployment, Document Management using Azure File Storage rather than Database.

Imagine a use case where within a PLSQL Procedure I need to retrieve the data contents of the File as BLOB/CLOB, in order to then be able to use it in the backend for other purposes (send mail, application message, etc.).

Is there a known API Method you guys know about that I can use, passing the document keys (doc no, doc class, doc rev, doc sheet, etc.) as parameters, and retrieving the Azure File Storage hosted file data contents as CLOB/BLOB ?

Tried to look in EDM_FILE_API, EDM_FILE_LOCATION_API but couldn’t really find anything in there. There’s Get_File_Data in EDM_FILE_STORAGE_API but that seems dedicated to database hosted documents rather than Azure FS.

Thank you !

Best answer by Mathias Dahl

Hi Simon,

Thanks for asking here. The short answer is that there's no way to stream the content from the File Storage repository into a variable in PL/SQL today. I'm not sure our technology stack would even support it without larger changes.

With that said, an easy way, which is obvious but I need to mention it anyway, is to use the Database repository for the kind of documents where you need to access the file content. Depending on your requirements this might or might not be practical (perhaps you cannot say on beforehand what documents you want to access that way, or even the subset of documents that has that class might be too many for you to want to keep them in the database).

Then there's a second option, which is to move the file you need to access to the database from the File Storage repository, before you do whatever it is that you need to do, then move it back. This is used in a very specific part of IFS Cloud (Financials, in Invoicing), only, and I'm not sure it's something you should start using, because we might remove that option later when this "workaround" (as I see it), is not needed anymore.

And, here's a third option: I haven't worked with workflows/BPA enough to say if this is possible, but possibly you can download a file in a workflow, calling the right REST API, and you will get a file stream back with which you can do whatever you want.

Lastly, you always have the option to develop something that runs "outside" IFS Cloud, which reads the file from our REST API and does something with it. That something could possibly be triggered from inside IFS Cloud, in some way.


 

View original

Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+32

Hi Simon,

Thanks for asking here. The short answer is that there's no way to stream the content from the File Storage repository into a variable in PL/SQL today. I'm not sure our technology stack would even support it without larger changes.

With that said, an easy way, which is obvious but I need to mention it anyway, is to use the Database repository for the kind of documents where you need to access the file content. Depending on your requirements this might or might not be practical (perhaps you cannot say on beforehand what documents you want to access that way, or even the subset of documents that has that class might be too many for you to want to keep them in the database).

Then there's a second option, which is to move the file you need to access to the database from the File Storage repository, before you do whatever it is that you need to do, then move it back. This is used in a very specific part of IFS Cloud (Financials, in Invoicing), only, and I'm not sure it's something you should start using, because we might remove that option later when this "workaround" (as I see it), is not needed anymore.

And, here's a third option: I haven't worked with workflows/BPA enough to say if this is possible, but possibly you can download a file in a workflow, calling the right REST API, and you will get a file stream back with which you can do whatever you want.

Lastly, you always have the option to develop something that runs "outside" IFS Cloud, which reads the file from our REST API and does something with it. That something could possibly be triggered from inside IFS Cloud, in some way.


 


Forum|alt.badge.img+12

@Mathias Dahl Thank you so much Mathias,

 

Although I understand you recommend not using your second option, could you tell me more about that, just so that I have a complete understanding of paths at my disposal ? How does one “move” a specific file from File Storage to database, and can that be achieved through the PLSQL Layer ?

 

The Repositories page lets you select storage functionality based on Doc Class but I’m not seeing an option to specify it at the document level so I’m not exactly sure how to do that :)

 

The other options could also be interesting depending on the use case, so I’ll make a note of them (could be for instance that some doc classes are never intended for sharing and so can always be safely stored in Azure, while some are specifically intended to be “public” and so can be stored in Database for that purpose)


Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+32
  • Superhero (Employee)
  • March 17, 2025

> Although I understand you recommend not using your second option, could you tell me more about that, just so that I have a complete understanding of paths at my disposal ? How does one “move” a specific file from File Storage to database, and can that be achieved through the PLSQL Layer ?

There is a method that you can call that will move a single file from the File Storage repository to the Database repository. When that's done, you can work with it as with any other file kept in the Database repository.

As I said, that's an option we might remove so it's not a good idea to depend on it and we might not replace it with something else since it's meant to be used only from "R&D code", if you understand what I mean.

> The Repositories page lets you select storage functionality based on Doc Class but I’m not seeing an option to specify it at the document level so I’m not exactly sure how to do that :)

That's correct. I didn't mean to say you could control which document repository is used for a single file. But depending on your exact needs, it might have been on option to have one document class where you only keep those files in the Database repository, right? But if the documents you want to access from PL/SQL are having different classes, this option is not viable.

> The other options could also be interesting depending on the use case, so I’ll make a note of them (could be for instance that some doc classes are never intended for sharing and so can always be safely stored in Azure, while some are specifically intended to be “public” and so can be stored in Database for that purpose)

Exactly 🙂
 


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