I'll paste the answer received by @Aya Heshmat 

Assuming the client is using a file stream and created a message header, we would expect the stream stored in the MGR/\stream folder to get cleaned with a purge. Because you can add custom code, the associated stream may not be getting deleted so they need to look at their code. If file sizes are large, global streams are preferrable over file streams since any failover would remove the reference and the stream which might be causing these items to not purge. Assuming the file path is potentially different on each failover member. if the resource is shared, I would still expect it to get purged.

Following the answer of Dmitry you can check this documentation about the Apache configuration to pass file types to the web gateway:

https://docs.intersystems.com/healthconnectlatest/csp/docbook/DocBook.UI...

As you can read in the doc the Apache server has to pass static files if you want to access to the portal manager, maybe that is the problem with your configuration. 

You have 2 options to return a value from a Method, one is to send by reference an object and instantiate that object inside the method called:

ClassMethod MyMethod(myInput As String, Output myOutput As MyPackage.MyClass) As %Library.Status
{
    set myOuput = ##class(MyPackage.MyClass).%New()
    set myOutput.name = "This is a name"
    
    return $$$OK
}

And invoke it like:

// Invoke method with .. if it belong to the same class or with ##class(classname).method if it doesn't
set tSC = ..MyMethod("One Input", .output)
// Now output has been created and output.name has the value "This is a name"
write output.name

You can see here in the documentation how to pass variables by reference:

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...