Do you have any error messages you can share?
Also, I noticed that you are generating the folder name dynamically... which is ok but are you sure that the folder in that name exists AND does the folder have the correct permissions (777 or 755 depending on server policy)?
Best regards,
Brian