The simplest option would be to use IIS to add a virtual directory in the CRM site pointing to the folder on the main site. You could then use
MapPath
to get the physical path of the folder:
string folderLocation = Server.MapPath("~/main-site-images/users/" + filename);
If you can't do that for some reason, then you'll need to specify the physical path directly. You'll probably want to put it in your config file, so that you don't have to recompile every time the path changes.
string folderLocation = System.IO.Path.Combine(WebConfigurationManager.AppSettings["mainSiteImagesPath"], "users", filename);