avoid hitting the 2MB limit

memory only works for files <= 2M, temp uses memory if possible but uses a temporary file if limit is hit