FileOutputStream in java

Hello All,   Is anyone has idea how we can get file in FileOutputStream(path) object in Java Action? I am sure what is the path i need to right here when or application on server.   Thanks & Regards Achal
1 answers

Unless you deploy on premises, you have almost no permissions to write data on the Mendix server. The only place where you can write files to is a temporary folder. To access the path, you need to use Core.getConfiguration.getTempPath(), as in the example code below.


	public static File getTempFile (String fileName) {
		String fileSeparator = Core.getConfiguration().getFileSeparator();
		File tempPath = Core.getConfiguration().getTempPath();
		File file = new File(tempPath + fileSeparator + fileName);
		return file;