Hi,
Sorry for delay.
Thanks for describing the problem again, I guess I just didnt get the problem earlier.
So the issue is when you trying to upload file or directory into subdirectory or file located in subdirectory.
If so I think I have a more elegant SCP style solution but will need some time to implement it as I will be busy with other project.
Thanks,
Oleg