That is very weird. The custom code should do the trick no matter what. I might be missing something here. Your configuration is correct, everything looks to be all right there, so I don't understand yet.
Feel free to add temporary FTP access as well, and I will try to debug through the code. It might be a bug I'm not aware of, I'm not sure to be honest.Best,
If you like my products, don't forget to rate them on codecanyon :)