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

PHP輸出到WORD跟EXCEL 簡易做法

PHP輸出到WORD跟EXC...

pexelsphotooffice WORD: $filename="test.doc&q...

刪除已上傳至server的檔案

刪除已上傳至server的檔...

a5 管理系統,難免都會遇到要更新或刪除已經上傳到server的檔案。 總不能只是重新上傳卻又不把舊...

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

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

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

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