write binary to temp folder