public byte[] GetFile(string fileName) // fileName = "/path/file.ext" { string[] tmp = fileName.Split('/'); string path = ""; for (int i = 0; i < tmp.Length - 1; i++) { if (tmp[i] != "") { path += tmp[i] + "/"; } } fileName = tmp[tmp.Length - 1]; return(AmazonS3.GetFile(path, fileName)); }