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中如何將NAN轉換為0

在PHP中如何將NAN轉換為...

首先我會得到NAN是因為我有一個計算結果為的值然後我讓他除以,結果就得到了NAN 首先甚麼是NAN?...

使用CSS 讓ul li 橫向水平

使用CSS 讓ul li 橫...

好吧,其實這個css常在用,但我每次都沒特別紀錄,然後每次又忘記然後又要Google。 其實主要就是...

PHP無法保存SESSION的問題

PHP無法保存SESSION...

一天,客戶反應系統後台無法登入。 而這問題是發生在客戶電腦更換了IP位置。 而我這邊也只是開放新的I...

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