public static getContentTypeForFile()

in apps/chat-e2e/src/testData/api/fileApiHelper.ts [129:152]


  public static getContentTypeForFile(filename: string) {
    const extension = filename.match(/(?<=\.)[^.]+$/g);
    if (extension) {
      switch (extension[0]) {
        case 'png':
          return 'image/png';
        case 'jpg':
        case 'jpeg':
          return 'image/jpeg';
        case 'gif':
          return 'image/gif';
        case 'webp':
          return 'image/webp';
        case 'json':
          return 'application/vnd.plotly.v1+json';
        case 'pdf':
          return 'application/pdf';
        default:
          return 'text/plain';
      }
    } else {
      return 'application/octet-stream'; // Default to generic binary type
    }
  }