we created a subfolder in files/application and uploaded a file in this subfolder. Now I would like to read this file to send it as an Email-attachment.

File f = new File("subfolder\\testfile.pdf",false);
java.io.File Anhang =new java.io.File(f.getName());

But ivy doesn't find the File. When we upload the file directly in files/application it works.

Thank you.

asked 24.03.2017 at 13:48

hayit's gravatar image

accept rate: 0%

Your second line causes the problem. f.getName() only returns the filename, without the subfolder. You have to use f.getPath(), which returns the relative path of the current file object. This path is always relative to the active file area:

  • Temporary files: session
  • Persistent files: application

answered 24.03.2017 at 15:24

SupportIvyTeam's gravatar image

SupportIvyTeam ♦♦
accept rate: 77%


(19.04.2017 at 05:45) Alex Suter ♦♦ Alex%20Suter's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 24.03.2017 at 13:48

Seen: 2,145 times

Last updated: 19.04.2017 at 05:45