This may do the trick
Removing debug statements
This fix will prevent that the stream is stopped before it has finished
This is hopefully the last needed fix for now
This works now even if no files are sent
Now the case of an empty file should be handled by the server