<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body><FONT color=#bb0000>[!This post never made it to LaTech, so I'm reposting it]</FONT><BR>
<BR> <BR>
<DIV class=ExternalClass>
<META content="Microsoft SafeHTML" name=Generator>
<STYLE>
.ExternalClass P
{padding:0px;}
.ExternalClass
{font-size:10pt;font-family:Tahoma;}
</STYLE>
> Would love to see what you might make.<BR> <BR>Doesn't everybody, including myself, hope and expect my statement<BR>to be true to a certain extent? <BR> <BR>I even googled a little just to find that there is no simple solution that<BR>will be able to validate dhe image size on the client side without serv-<BR>erside roundtrips. etc. And it's...<BR>-Sad!<BR> <BR>Right now,<BR>all I can show you is this brute prtotype of demonstration code.<BR> <BR>-Test this:<BR> <BR><FORM name="upl" onsubmit = "" action = "" method = "post" ><BR> <INPUT type="file" size="124" <BR> name="filecontent" <BR> value="" onchange="setImg()"/> <BR></FORM></DIV>
<DIV class=ExternalClass><BR><script><BR><BR>function setImg(){<BR> imgTester.src=document.upl.filecontent.value<BR> }<BR>function validate(){ </DIV>
<DIV class=ExternalClass> alert(imgTester.fileSize)</DIV>
<DIV class=ExternalClass>//your condtitionals and submit decision cn go here..<BR> }<BR></script><BR> <BR><img src=""<BR> style='height:100px; width:100px; display:none' <BR> id='imgTester' <BR> name='imgTester' <BR> onload='validate()' \><BR> <BR>***<BR>This will work on IE version browsers for sure, I leave it up to you guys </DIV>
<DIV class=ExternalClass>to find the way to make it compatible with other browsers, because this</DIV>
<DIV class=ExternalClass>is only a demonstration of the prime idea...</DIV>
<DIV class=ExternalClass> <BR>Regards.<BR><BR><BR>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <BR> Troy III <BR> progressive art enterprise<BR>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<BR><BR><BR><BR></DIV>
<HR id=stopSpelling>
<BR>
> Date: Fri, 13 Jul 2007 21:04:14 -0400<BR>> To: javascript@LaTech.edu<BR>> From: tedd@sperling.com<BR>> Subject: RE: [Javascript] Resizing images client-side<BR>> CC: trojani2000@hotmail.com<BR>> <BR>> At 11:34 PM +0000 7/13/07, Troy III Ajnej wrote:<BR>> >Hi Paul<BR>> ><BR>> >Hahahahaa,<BR>> >If I wasn't drunked last night and didn'tmcompletely missunderstood<BR>> >the problem, I believe it is very easy to get it done via javascript.<BR>> ><BR>> >As I remember (?)Tedd asked about how to disable or prevent the<BR>> >client from uploading large pictures, suppose, not bigger than 500k.<BR>> ><BR>> >All it takes is just a little bit of imagination or creativity. I <BR>> >will describe<BR>> >the routine not the code itself since you all know how writte one.<BR>> ><BR>> >You will need a "bypass function" for "submit".<BR>> >1. get the picture file to load on the page.<BR>> >2. use the onload event of the image object to check for image filesize.<BR>> >3. compare, the actuall f-size with your max limit size, and let the "con-<BR>> >ditional" decide what statement to execute.<BR>> >4 That is: alert box that tells the user the file exceeds the maximum<BR>> >alowed or submit it right away.<BR>> ><BR>> >And it will all take only a second for the function to complete.<BR>> ><BR>> >If I wasn't clear, please dont hesitate to ask. I might find some time to<BR>> >actually write the code and post it here.<BR>> >:)<BR>> >Regards<BR>> ><BR>> <BR>> I couldn't help but think there was something like that -- however -- <BR>> I couldn't find it. I did read about the FileUpLoad Object, but it <BR>> does not provide a size property.<BR>> <BR>> Would love to see what you might make.<BR>> <BR>> Cheers,<BR>> <BR>> tedd<BR>> <BR>> <BR>> -- <BR>> -------<BR>> http://sperling.com http://ancientstones.com http://earthstones.com<BR>> _______________________________________________<BR>> Javascript mailing list<BR>> Javascript@LaTech.edu<BR>> https://lists.LaTech.edu/mailman/listinfo/javascript<BR><BR><br /><hr />PC Magazine’s 2007 editors’ choice for best web mail—award-winning Windows Live Hotmail. <a href='http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HMWL_mini_pcmag_0707' target='_new'>Check it out!</a></body>
</html>