public FileStruct AddFile(ref string request, ref byte[] buffer, ref int bytes)
 {
     if (CheckHeadersFileRequest(ref request))
     {
         byte[] binFile = GetBinaryRequest(request, buffer, bytes);
         if (binFile == null)
         {
             return(null);
         }
         else
         {
             FileStruct file = GetFileStructRequest(ref request);
             file.Name = GetFileName(request);
             CreateFileBinary(file.Path + file.Name, ref binFile);
             database.AddFile(file);
             return(file);
         }
     }
     else
     {
         return(null);
     }
 }