Don't give your USERS a Headache. Let's do their Photo Resizing (PR)

Displaying a photo where its dimension exceeds the web-page's layout can damage or distort the entire look of the website. This happens when you allow or offer Users a functionality (app / application) to upload their own photos. Hackers and Trolls may also use this application to intentionally upload un-resized images. But by dynamically resizing photos, you can eliminate that hacking possibility while doing a special favor to your Users. Accept any photo dimensions and filesizes. However in every website, there should be a preferred maximum size of images to be accepted. Facebook's preferred size is 4MB while in this example, we prefer 5MB. ;) On image files, .jpg is widely used by digital cameras but we will also accept .gif and .png still. I used OO PHP, PHP GD Library, OO JavaScript, AHAH (Asynchronous HTML And HTTP), JQUERY, Flash ActionScript I built this special "browse" and "upload" buttons using Flash 8.
Allowing image size up to 5MB only !
You MUST install your Flash Player in this Browser. Please visit
In this example, the maximum photo width is 200 pixels. Otherwise, width will be scaled down.
To test this application, upload photos having width higher than 200 pixels .
Checking filesizes in the client-side can't be done using JavaScript so I also used
Flash ActionScript in this app.

The "height" here is less important since a client browser is scrolled down normally when "height" is tall
while scrolling to the right is very unlikely when the "width" is too wide.

Let's tackle file upload using Flash and PHP on a separate section.

Grab the code of the Flash Uploader from