From a9c6195bcdafcad21eb2065a85bc7554912c0542 Mon Sep 17 00:00:00 2001 From: minpeter Date: Thu, 20 Oct 2022 21:53:49 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=EC=96=B4=EB=8A=90=20=EC=8B=9C=EC=A0=90?= =?UTF-8?q?=EC=97=90=20=EC=82=AC=EB=9D=BC=EC=A7=84=20files=20=ED=95=84?= =?UTF-8?q?=EB=93=9C=20=EB=B3=B5=EC=9B=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/main/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/main/index.tsx b/src/pages/main/index.tsx index 06edb9a..ac5704f 100644 --- a/src/pages/main/index.tsx +++ b/src/pages/main/index.tsx @@ -14,7 +14,7 @@ export const MainPage: React.FC = () => { const [retentionPeriod, setRetentionPeriod] = useState(false); const [downloadCount, setDownloadCount] = useState(false); const [passwordBoolean, setPasswordBoolean] = useState(false); - const [fileProps, setFileProps] = useState({ name: '', size: '', fileType: '' }); + const [fileProps, setFileProps] = useState({ name: '', size: '', fileType: '', files: '' }); const navigate = useNavigate(); @@ -23,16 +23,17 @@ export const MainPage: React.FC = () => { const handleChangeFile = (event: any) => { setFileProps({ - name: event.target.files[0].name.split('.')[0], + name: event.target.files[0].name, size: getFileSize(event.target.files[0].size), fileType: event.target.files[0].name.split('.')[1], + files: event.target.files[0], }); }; const UpLoad = async () => { if (fileProps.name != '' && fileProps.size != '') { const formdata = new FormData(); - formdata.append('file', fileProps.name); + formdata.append('file', fileProps.files); await axios({ method: 'post', url: 'https://tfb.minpeter.cf/upload', From 0832bb8ba21ebd55993d6502765735879fdd17ac Mon Sep 17 00:00:00 2001 From: minpeter Date: Thu, 20 Oct 2022 21:55:01 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=EB=82=98=EC=A4=91=EC=97=90=20=EC=95=8C?= =?UTF-8?q?=EC=95=84=EB=B3=BC=20=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?files=20->=20fileData=EB=A1=9C=20=EB=B3=80=EC=88=98=EB=AA=85=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/main/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/main/index.tsx b/src/pages/main/index.tsx index ac5704f..4a4e9b5 100644 --- a/src/pages/main/index.tsx +++ b/src/pages/main/index.tsx @@ -14,7 +14,7 @@ export const MainPage: React.FC = () => { const [retentionPeriod, setRetentionPeriod] = useState(false); const [downloadCount, setDownloadCount] = useState(false); const [passwordBoolean, setPasswordBoolean] = useState(false); - const [fileProps, setFileProps] = useState({ name: '', size: '', fileType: '', files: '' }); + const [fileProps, setFileProps] = useState({ name: '', size: '', fileType: '', fileData: '' }); const navigate = useNavigate(); @@ -26,14 +26,14 @@ export const MainPage: React.FC = () => { name: event.target.files[0].name, size: getFileSize(event.target.files[0].size), fileType: event.target.files[0].name.split('.')[1], - files: event.target.files[0], + fileData: event.target.files[0], }); }; const UpLoad = async () => { if (fileProps.name != '' && fileProps.size != '') { const formdata = new FormData(); - formdata.append('file', fileProps.files); + formdata.append('file', fileProps.fileData); await axios({ method: 'post', url: 'https://tfb.minpeter.cf/upload', From 203ab16a757405608e954a0f06cf3ef404e43f1b Mon Sep 17 00:00:00 2001 From: minpeter Date: Thu, 20 Oct 2022 21:55:01 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=EB=82=98=EC=A4=91=EC=97=90=20=EC=95=8C?= =?UTF-8?q?=EC=95=84=EB=B3=BC=20=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?files=20->=20fileData=EB=A1=9C=20=EB=B3=80=EC=88=98=EB=AA=85=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20#1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/main/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/main/index.tsx b/src/pages/main/index.tsx index ac5704f..4a4e9b5 100644 --- a/src/pages/main/index.tsx +++ b/src/pages/main/index.tsx @@ -14,7 +14,7 @@ export const MainPage: React.FC = () => { const [retentionPeriod, setRetentionPeriod] = useState(false); const [downloadCount, setDownloadCount] = useState(false); const [passwordBoolean, setPasswordBoolean] = useState(false); - const [fileProps, setFileProps] = useState({ name: '', size: '', fileType: '', files: '' }); + const [fileProps, setFileProps] = useState({ name: '', size: '', fileType: '', fileData: '' }); const navigate = useNavigate(); @@ -26,14 +26,14 @@ export const MainPage: React.FC = () => { name: event.target.files[0].name, size: getFileSize(event.target.files[0].size), fileType: event.target.files[0].name.split('.')[1], - files: event.target.files[0], + fileData: event.target.files[0], }); }; const UpLoad = async () => { if (fileProps.name != '' && fileProps.size != '') { const formdata = new FormData(); - formdata.append('file', fileProps.files); + formdata.append('file', fileProps.fileData); await axios({ method: 'post', url: 'https://tfb.minpeter.cf/upload',