Updated script to store files in temp data folder