Client control upload Image size

Source: Internet
Author: User
Tags file size file upload reset client
Client | control | Upload <! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
<title> client control upload image size sample-51windows</title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<body>
<p> Below is an example of a client-controlled file upload image size that users can circumvent because of the client-side restrictions. </p>
<script language= "JavaScript" >
<!--
var filemaxsize = 50;//Limit uploaded file size, unit (k)
function Chkform () {
if (document. hwform.photo.value== "") {alert ("Please select Photo");d ocument. HwForm.Photo.focus (); return false;}
if (document. hwform.photofilesize.value<=0) {alert ("Please select a photo");d ocument. HwForm.Photo.focus (); return false;}
if (document. hwform.photofilesize.value>filemaxsize*1024) {alert ("The selected photos exceed" +filemaxsize+ "K, please select Again");d ocument. HwForm.Photo.focus (); return false;}
Alert ("Can be committed, currently testing ..."), return false;
}
-->
</SCRIPT>
<form method= "POST" name= "Hwform" enctype= "Multipart/form-data" >
Photo (Please select a picture file within 50K): <input type= "file" Name= "Photo" onpropertychange= "if (document). Hwform.photo.value!= ') {document.getElementById (' photoimg '). Src=document. HwForm.Photo.value;} " /><input size= "3" type= "hidden" name= "Photofilesize" value= "-1"/>
<input type= "Submit" value= "submitted" > <input type= "reset" value= "reset" >
</form>
</body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.