migration function for uploaded files