Hello,

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());
in.anhang=Anhang;

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

hayit
(suspended)
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
link

answered 24.03.2017 at 15:24

SupportIvyTeam's gravatar image

SupportIvyTeam ♦♦
1.4k102118122
accept rate: 77%

testtesttest

(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

By RSS:

Answers

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

Tags:

×34
×18
×7

Asked: 24.03.2017 at 13:48

Seen: 2,173 times

Last updated: 19.04.2017 at 05:45