I am working on a requirement where we need to create a CSV file from SQL database and save the file in DAM location. In order to create the CSV file in DAM location I am unsing AssetManager.createAsset("/content/dam/../..test.csv", is, "text/csv", true).
The issue that I am facing here is inorder to create asset we need an InputStream object, so I am first creating a File object and then using CSVWriter to create a CSV in another location and then converting that File object to InputStream like this ::InputStream is = new FileInputStream(csvFile);
Can someone please suggest me an approach where I can create the CSV file directly in DAM location.
Thanks for the reply. I have checked this, but this is slightly different from my requirement, I just want to create a .csv file programmatically and place it in DAM. This file will then be pushed to another server to other uses.