Bugfix: Perform HTTP request before closing local file.