Loading...

使用jquery判斷上傳檔案大小

Temperature: 0 °C

Mark ChangMark Chang
author_tools

首先得引用jquery

var fileSize = document.getElementById('filesid').files[0]; //獲得文件大小;
if(fileSize.size>5242880){
   alert('上傳檔案不能超過5MB');                
   return false;
}

上傳檔案若超過5MB,直接中斷。

以上紀錄。
 

https://innstory.com/story-使用jquery判斷上傳檔案大小-1881
javascript

Prev
 Android_Fragment及Activity_中使用sharedpreferences

Next
javascript如何取得檔案的副檔名 

About the Author

Mark Chang

離不開電腦的宅男

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

fancybox close的方式

fancybox close...

parent.$.fancybox.close(); parent.jQuery.fancybox....

javascript如何通過其 ID 設置選擇元素的選定選項?

javascript如何通過...

如題,透過javascript來針對某個select的option來做選定。 document.ge...

使用JavaScript的split函式完成字串切割

使用JavaScript的s...

使用JavaScript的split 函式可以用來切割字串。 根據設定的切割點執行切開的動作。 以下...

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format