diff --git a/docker/nocobase-full/nocobase.conf b/docker/nocobase-full/nocobase.conf
index 61ddc70335..7de9bbb630 100644
--- a/docker/nocobase-full/nocobase.conf
+++ b/docker/nocobase-full/nocobase.conf
@@ -17,7 +17,7 @@ server {
server_name _;
root /app/nocobase/packages/app/client/dist;
index index.html;
- client_max_body_size 20M;
+ client_max_body_size 0;
access_log /var/log/nginx/nocobase.log apm;
diff --git a/docker/nocobase/nocobase.conf b/docker/nocobase/nocobase.conf
index 7c0c4d2c41..d178440bf9 100644
--- a/docker/nocobase/nocobase.conf
+++ b/docker/nocobase/nocobase.conf
@@ -17,7 +17,7 @@ server {
server_name _;
root /app/nocobase/node_modules/@nocobase/app/dist/client;
index index.html;
- client_max_body_size 1000M;
+ client_max_body_size 0;
access_log /var/log/nginx/nocobase.log apm;
gzip on;
diff --git a/packages/core/cli/nocobase.conf.tpl b/packages/core/cli/nocobase.conf.tpl
index a40343cc02..141ca74282 100644
--- a/packages/core/cli/nocobase.conf.tpl
+++ b/packages/core/cli/nocobase.conf.tpl
@@ -17,7 +17,7 @@ server {
server_name _;
root {{cwd}}/node_modules/@nocobase/app/dist/client;
index index.html;
- client_max_body_size 1000M;
+ client_max_body_size 0;
access_log /var/log/nginx/nocobase.log apm;
gzip on;
diff --git a/packages/core/client/src/schema-component/antd/input/ReadPretty.tsx b/packages/core/client/src/schema-component/antd/input/ReadPretty.tsx
index 94f038ddea..3bf5255fec 100644
--- a/packages/core/client/src/schema-component/antd/input/ReadPretty.tsx
+++ b/packages/core/client/src/schema-component/antd/input/ReadPretty.tsx
@@ -199,11 +199,29 @@ export interface URLReadPrettyProps {
}
const ellipsisStyle = { textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', display: 'block' };
+
+function encodeFileURL(url: string): string {
+ if (!url) {
+ return url;
+ }
+
+ const parts = url.split('/');
+ const filename = parts.pop();
+ parts.push(encodeURIComponent(filename));
+ const encodedURL = parts.join('/');
+ return encodedURL;
+}
+
ReadPretty.URL = (props: URLReadPrettyProps) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const prefixCls = usePrefixCls('description-url', props);
const content = props.value && (
-
+
{props.value}
);
diff --git a/packages/core/client/src/schema-component/antd/upload/Upload.tsx b/packages/core/client/src/schema-component/antd/upload/Upload.tsx
index 57b00995d9..098dff9f52 100644
--- a/packages/core/client/src/schema-component/antd/upload/Upload.tsx
+++ b/packages/core/client/src/schema-component/antd/upload/Upload.tsx
@@ -32,6 +32,7 @@ import {
toValueItem as toValueItemDefault,
useBeforeUpload,
useUploadProps,
+ encodeFileURL,
} from './shared';
import { useStyles } from './style';
import type { ComposedUpload, DraggerProps, DraggerV2Props, UploadProps } from './type';
@@ -89,26 +90,27 @@ attachmentFileTypes.add({
},
});
-const iframePreviewSupportedTypes = ['application/pdf', 'audio/*', 'image/*', 'video/*'];
+const iframePreviewSupportedTypes = ['application/pdf', 'audio/*', 'image/*', 'video/*', 'text/*'];
function IframePreviewer({ index, list, onSwitchIndex }) {
const { t } = useTranslation();
const file = list[index];
+ const url = encodeFileURL(file.url);
const onOpen = useCallback(
(e) => {
e.preventDefault();
e.stopPropagation();
- window.open(file.url);
+ window.open(url);
},
- [file],
+ [url],
);
const onDownload = useCallback(
(e) => {
e.preventDefault();
e.stopPropagation();
- saveAs(file.url, `${file.title}${file.extname}`);
+ saveAs(url, `${file.title}${file.extname}`);
},
- [file],
+ [file.extname, file.title, url],
);
const onClose = useCallback(() => {
onSwitchIndex(null);
@@ -148,7 +150,7 @@ function IframePreviewer({ index, list, onSwitchIndex }) {
>
{iframePreviewSupportedTypes.some((type) => matchMimetype(file, type)) ? (