Skip to content

Commit

Permalink
Update files.tmpl
Browse files Browse the repository at this point in the history
  • Loading branch information
csznet authored Oct 17, 2023
1 parent e77364b commit 3109380
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions assets/templates/files.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<div id="response" class="ui-widget"></div>
<script>
function uploadFile(file) {
if (file.size <= 10 * 1024 * 1024) {
var limit = 10 * 1024 * 1024;
if (file.size <= limit) {
uploadImg(file,1).then((url) => {
// 处理上传成功的情况
console.log(url);
Expand All @@ -16,7 +17,7 @@ function uploadFile(file) {
});
} else {
// 文件大于20MB,需要分割成多个块
var chunkSize = 4 * 1024 * 1024; // 20MB
var chunkSize = limit; // 20MB
var start = 0;
var end = Math.min(chunkSize, file.size);

Expand Down

0 comments on commit 3109380

Please sign in to comment.