0

I am new to cloud foundry. I am currently working on a requirement where I have to upload a CSV file (via JSP UI) into a service deployed in cloud foundry and persists its data in service. The issue is from UI, I only get a local path of that CSV file and when I am trying to parse that CSV via this path the file is not recognized. I guess the reason is service is already deployed in CF, so it does not recognize this local machine path. Can you please let me know how can I parse this CSV file in local machine and where to parse this CSV.

Thanks in Advance!

Rasp_DJ
  • 1
  • 2

1 Answers1

1

There is nothing specific to Cloud Foundry about how you would receive an uploaded file in a web application. Since you mentioned using Java, I would suggest checking out this post.

How to upload files to server using JSP/Servlet?

The only thing you need to keep in mind that's specific to Cloud Foundry is that the filesystem in Cloud Foundry is ephemeral. It behaves like a normal filesystem and you can write files to it, however, the lifetime of the filesystem is equal to the lifetime of your application instance. That means restarts, restages or anything else that would cause the application container to be recreated will destroy the file system.

In short, you can use the file system for caching or temporary files but anything that you want to retain should be stored elsewhere.

https://docs.cloudfoundry.org/devguide/deploy-apps/prepare-to-deploy.html#filesystem

Daniel Mikusa
  • 13,716
  • 1
  • 22
  • 28