Store file in UD table

I’m working on an integration that requires a file to be consumed by a service. I want to consider storing the file (PDF) in a UD table but I’m not sure if this is possible or frowned upon.
Any guidance and help getting started is appreciated

1 Like

While it is not frowned upon it will drastically increase the size of your DB. You are way better off storing a LINK to the file somewhere in your network.

If I stored the link, I’m guessing the service would need to be able to access that directory to consume the file? One of the issues are the documents are typically stored on the users machine rather than a shared location

You need to chunk it. There is a utility to do this but I agree with Jose, I dont think it’s the best option.

You could have your service copy it to a central location instead of to the database.

1 Like

Correct, what your service can do is pull that file from the user machine and copy it to a location in the network if the goal is to keep them.

1 Like

Or you could use the API that is built for storing files -

4 Likes

Damn it @Bart_Elia with the save. This for the attachments? or are the files stored in the new File/ImageStore table?

Wow, I had no idea this existed…this would be perfect I think

1 Like

There are actually two APIs.

  • Ice.Lib.FileStoreSvc - for the database
  • Ice.Lib.FileTransferSvc - for the file system

Both have tenant and company isolation depending on deployment.

1 Like

I’m going to have my application copy a file that the user selects from their machine to a file share. Then, a virtual directory will serve up that file. The calling application uses the Epicor API to read the UD table to find the file path, is it still appropriate to use the FileTransferSvc to consume the file?

You’ll have to deal with the file share permission at the OS level - sharing C:\EpicorData or whatever you have configured. I can see that being fine in some scenarios. Obviously not SaaS but on premises you can make that work.