If a domain is invalid or a web server is down, cURL will return false and not have a status code. We need to catch it and distinguish the difference between page not found and cannot connect for the user.
Add a file extension since the Chrome version I tested didn’t infer the file extension.
When a user tries to save a file from the browser, make the filename the url they entered so they don’t have to type it again.