Using pub.client.ftp:put with a Stream

I am trying to send a file using the service pub.client.ftp:put, and since the file may be quite large (>50MO), I’d like not to load it in memory.
So I’ve decided to use
pub.file:getFile(loadAs: stream).

Then I map the stream object into the put service.

As a result, I do get a file… which contains exactly:
“” :confused:

Apparently my stream was serialized before being used, but that was not exactly what I was going after :frowning:

I’ve called stream.getClass().getName() on the object I got from the “getFile”, and it IS a “”.

So, has anyone ever experienced this?

I will try to call the put service inside a java service so I’m sure what happens to my stream, but this is not a really good solution…

I’m using IS 6.5 and Developper 6.5

Thanks in advance!

BufferedInputStream is a subclass of InputStream. The getFile service is functioning properly. It is not loading the file into memory. What you see in the Results pane in Developer is the result of Object.toString applied to BufferedInputStream.

Pass that to the put service. It will function as you desire.

I think I’m going to cry…

Actually the “put” service works as it should, but I was looking at another file which was written using a custom service that does write the stream directly (which I admit is a stupid idea)

Sorry for the inconvenience :o