Prevent folder upload causing unexpected behavior

Improves the detection of folder upload, which isn't supported on stable6

Fix for #9050

cc @jpaechnatz @DeepDiver1975