Hello Someone,
Greetings! Welcome to Microsoft Q&A Platform.
I understand that you’re encountering connection timeouts when using curl to download a file with a shared access signature (SAS) URL.
1.The timeouts you’re experiencing might be due to various factors, such as network latency, server load, or firewall restrictions. To prevent timeouts, consider adjusting the connection timeout using the --connect-timeout option. For example:
curl --connect-timeout 300 -o /home/user/test
"https://bucket.file.core.windows.net/folder/file?SAS"
This sets a 5-minute timeout (300 seconds) for the connection.
2.As you mentioned it may be due to the file lacks an extension. Ensure that the server correctly identifies the file type based on its content. If the server doesn’t provide a Content-Type header, you can specify it explicitly using the -H option
curl -H "Content-Type: application/octet-stream" -o /home/user/test "https://bucket.file.core.windows.net/folder/file?SAS"
3.Check your DNS settings. Sometimes DNS resolution issues can cause timeouts and verify that the hostname in the URL (bucket.file.core.windows.net) resolves correctly.
Similar thread for reference - https://stackoverflow.com/questions/59080379/why-does-my-curl-command-fail-to-download-a-file-most-of-the-time-but-sometimes
Hope this answer helps! Please let us know if you have any further queries. I’m happy to assist you further.
Please "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.