Yes, you can create a server and a client in totally different languages and on totally different platforms as long as they exchange data in an agreed upon format. Generally these days the format of choice is JSON though XML was a popular format in the past. Understand that in both cases you're not sending "files" but text data.
You may want to read up on RESTful APIs which are a standard way of representing web services these days.