@Imran Khan
The SMB protocol is currently the preferred file share protocol used on-premises today. There are various ways to workaround this such as using VPN, REST API, or Azure File Sync. If you are are already using http links to store the files perhaps moving towards a solution with blob storage might be a better solution for you.
I hope this information was helpful. Please let us know if you have further questions or issues.
---------------
Please don’t forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.