How can i get the file path to my java code

0
How can i get the file path to my java code so that i can change the file format extension to PDF and again how can i get the file to be saved in the original mendix folder structure will the first file need to be deleted?
asked
2 answers
1

It would not help to change the file format to pdf because mendix file documents are stored as numbered files without file extension.

You can read and write filedocuments with Java action Core functions.

Can you give more information about the problem?

Edit: I recommend to read the original filedocument, create a new filedocument, convert the original filedocument using Core.getFileDocumentContent, Core.storeFileDocumentContent. After that delete the original filedocument.

Edit: Ad 1 Pushing to the java-action: you can do it in after commit of the filedocument. Ad 2 What happens with the uploaded file is up to you. You have to delete it manually. Ad. You can use a temporary file (Core has a method to get one). But the PDF conversion must be done by you

answered
0

Okay well this is the scenario, i want to upload any document to the system and if its not a .PDF i should be able to convert the document to PDF. So i saw that mendix cannot do that but i thought of using a Java action but i can seem to find a way to push the uploaded file document to the java action

  1. Is they a way for me to do that..push the file to the java action
  2. Where will the new converted file be stored
  3. what will happen to the original file that was uploaded
  4. Or is the a better way to convert there uploaded file to pdf using mendix
answered