Core: fixed bad download logic

* temp file write
+ check HTTP response code