use mod_headers to save bandwidth
change /tmp to function sys_get_temp_dir