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

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

如何緩存靜態資源使用HTTP緩存

如何緩存靜態資源使用HTTP緩存

配置服務器以返回CacheControlHTTP響應標頭: CacheControl:...

PDO PHP - PDOException - Numeric value out of range: 1264 Out of range value for column user_ip at row 1

PDO PHP - PDOException - Numeric value out of range: 1264 Out of range value for column user_ip at row 1

最近遇到一個問題,一個Mysql的錯誤訊息。 我想要紀錄一個IP資訊,我會先用以下方式...

當XAMPP遇到VMWARE占用PORT 443導致無法啟動APACHE

當XAMPP遇到VMWARE占用PORT 443導致無法啟動APACHE

在使用XAMPP時,若系統有安裝 VMWare Workstation,VMWare會...

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