[Javascript] Resizing images client-side

L Lay llay at laysercomputing.com
Fri Jul 13 09:06:52 CDT 2007


tedd wrote:
> At 1:11 AM +0000 7/13/07, Troy III Ajnej wrote:
>> Why don't you simply get the filesize of the image the client is about
>> to upload (via client script) and hit him with the message: "this 
>> file is
>> to large\n  the file must  be smaller than...," etc.
>>
>
> Hi Troy
>
> You care to provide an example of this simple operation?
>
> My understanding is that I can't get the file size until I get the 
> file -- is that wrong?
>
> Cheers,
>
> tedd
Tedd,

I don't know about Javascript, but are you aware of the max_file_size 
hidden field in PHP?  It can be easily fooled, but it helps a bit 
because it notifies users of problems before you attempt to process the 
file.  It's just a time saving measure.

Have a look at:
<http://php.net/manual/en/features.file-upload.php>

Lori



More information about the Javascript mailing list