Upload in subdirectory is not working

I broke something in the upload process with my last PR, this fixes it.

I also fixed an old bug that is particularly with bulk actions, where the number of elements in a folder was not refreshed.

I have more small things to come, but I think that the upload bug is too critical to wait for them.