How can I prevent that a Client can search a file in any directory of the Server? [on hold]

0

For an university project I developed in Linux, using C language, a Client and a Server. When I run my Client I pass as arguments of the program the filenames (one or more) to request to the Server. The Server should search the file with the corresponding name in its current directory and if it finds it, it sends it to the Client. If as filename I use only the name of the file, for example try.txt, it’s all ok, but how can I avoid that someone who use my Client try to go up on the path and search file in other directories, for example writing “../try.txt”?