<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>&nbsp;<BR>
<DIV class=ExternalClass>
<META content="Microsoft SafeHTML" name=Generator>
<STYLE>
.ExternalClass P
{padding:0px;}
.ExternalClass
{font-size:10pt;font-family:Tahoma;}
</STYLE>
&gt; Would love to see what you might make.<BR>&nbsp;<BR>Doesn't everybody, including myself, hope and expect my statement<BR>to be true to a certain extent? <BR>&nbsp;<BR>I even&nbsp;googled a little just&nbsp;to find&nbsp;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>&nbsp;<BR>Right now,<BR>all I can&nbsp;show you&nbsp;is this brute prtotype of&nbsp;demonstration code.<BR>&nbsp;<BR>-Test this:<BR>&nbsp;<BR>&lt;FORM name="upl"&nbsp;onsubmit = ""&nbsp;action = ""&nbsp;method = "post" &gt;<BR>&nbsp;&nbsp;&nbsp; &lt;INPUT type="file" size="124" <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name="filecontent" <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value="" onchange="setImg()"/&gt; <BR>&lt;/FORM&gt;</DIV>
<DIV class=ExternalClass><BR>&lt;script&gt;<BR><BR>function setImg(){<BR>&nbsp;imgTester.src=document.upl.filecontent.value<BR>&nbsp;}<BR>function validate(){ </DIV>
<DIV class=ExternalClass>&nbsp;alert(imgTester.fileSize)</DIV>
<DIV class=ExternalClass>//your condtitionals and submit decision cn go here..<BR>&nbsp;}<BR>&lt;/script&gt;<BR>&nbsp;<BR>&lt;img src=""<BR>&nbsp;style='height:100px; width:100px; display:none' <BR>&nbsp;id='imgTester' <BR>&nbsp;name='imgTester' <BR>&nbsp;onload='validate()' \&gt;<BR>&nbsp;<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>&nbsp;<BR>Regards.<BR><BR><BR>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Troy III <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; progressive art enterprise<BR>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<BR><BR><BR><BR></DIV>

<HR id=stopSpelling>
<BR>
&gt; Date: Fri, 13 Jul 2007 21:04:14 -0400<BR>&gt; To: javascript@LaTech.edu<BR>&gt; From: tedd@sperling.com<BR>&gt; Subject: RE: [Javascript] Resizing images client-side<BR>&gt; CC: trojani2000@hotmail.com<BR>&gt; <BR>&gt; At 11:34 PM +0000 7/13/07, Troy III Ajnej wrote:<BR>&gt; &gt;Hi Paul<BR>&gt; &gt;<BR>&gt; &gt;Hahahahaa,<BR>&gt; &gt;If I wasn't drunked last night and didn'tmcompletely missunderstood<BR>&gt; &gt;the problem, I believe it is very easy to get it done via javascript.<BR>&gt; &gt;<BR>&gt; &gt;As I remember (?)Tedd asked about how to disable or prevent the<BR>&gt; &gt;client from uploading large pictures, suppose, not bigger than 500k.<BR>&gt; &gt;<BR>&gt; &gt;All it takes is just a little bit of imagination or creativity. I <BR>&gt; &gt;will describe<BR>&gt; &gt;the routine not the code itself since you all know how writte one.<BR>&gt; &gt;<BR>&gt; &gt;You will need a "bypass function" for "submit".<BR>&gt; &gt;1. get the picture file to load on the page.<BR>&gt; &gt;2. use the onload event of the image object to check for image filesize.<BR>&gt; &gt;3. compare, the actuall f-size with your max limit size, and let the "con-<BR>&gt; &gt;ditional" decide what statement to execute.<BR>&gt; &gt;4 That is: alert box that tells the user the file exceeds the maximum<BR>&gt; &gt;alowed or submit it right away.<BR>&gt; &gt;<BR>&gt; &gt;And it will all take only a second for the function to complete.<BR>&gt; &gt;<BR>&gt; &gt;If I wasn't clear, please dont hesitate to ask. I might find some time to<BR>&gt; &gt;actually write the code and post it here.<BR>&gt; &gt;:)<BR>&gt; &gt;Regards<BR>&gt; &gt;<BR>&gt; <BR>&gt; I couldn't help but think there was something like that -- however -- <BR>&gt; I couldn't find it. I did read about the FileUpLoad Object, but it <BR>&gt; does not provide a size property.<BR>&gt; <BR>&gt; Would love to see what you might make.<BR>&gt; <BR>&gt; Cheers,<BR>&gt; <BR>&gt; tedd<BR>&gt; <BR>&gt; <BR>&gt; -- <BR>&gt; -------<BR>&gt; http://sperling.com http://ancientstones.com http://earthstones.com<BR>&gt; _______________________________________________<BR>&gt; Javascript mailing list<BR>&gt; Javascript@LaTech.edu<BR>&gt; 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>