Question
· Jan 6, 2021

Get file size from SFTP Service

Hi Everyone!

I try to get the file size from an Archive in a SFTP service. The input is a %Stream.Object.

I'm trying to use input.Size or input.SizeGet() but i´ve got the next error:

Any suggestions?

Thanks in advance  =D

Product version: IRIS 2019.1
Discussion (3)1
Log in or sign up to continue

As Eduard suggests, you need to know the class that the pInput object is derived from as it doesn't seem to be a valid Stream if .Size fails.

It also looks like you might be expecting a file as you retrieve the name so why not use the %File class if the file already exists.

In fact, noting how you get the Filename using the Attributes method this looks like the pInput object is a response with content which means the actual stream will be in pInput.Content