Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

Uploading image to a container with fixed dimensions



7:26 am on Jul 12, 2012 (gmt 0)


CSS and Javascript can be used.

We want to upload an image in a container with fixed dimensions (height and width).

There are many conditions:

1) if the image is larger than the container, then it should ask the user to crop the image according to the dimensions of the container.

2) if the image is of same dimensions - then will upload properly.

3) if the height is more, and width less - then the image will be uploaded vertically center aligned.

4) If the height is less and width more - then the image will be uploaded horizontal center aligned.

5) If the height and image is less - then the image should be center aligned.


7:37 am on Jul 12, 2012 (gmt 0)

Please can anyone help in this case.

Thank you in advance!


3:11 pm on Jul 12, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Since you'll need server-side software to allow users to upload images to your website, it's probably best to use a script that will automatically resize the images to suit your needs. I'm sure that if you search for an image upload script that you'll be able to find one that will do the job.


4:14 am on Jul 13, 2012 (gmt 0)

Thank you for your reply Rainborick. But please can you help me in this case as well as I am totally a fresher person. Thank you in advance!


4:23 am on Jul 13, 2012 (gmt 0)

10+ Year Member Top Contributors Of The Month

If your site is on a Windows server you will need a DLL installed on the server and usually the licence needs to be purchased. Some Windows web hosts already include them in their offerings, otherwise a DLL may not required if your site is on an Apache server. The significance of the DLL is that it will require administrator rights on the server, usually from the owner of the server.

Looking though the list of goodies available for Wordpress, Joomla or Drupal I did see a module that can be used for what you want. Those modules are usually free.


4:32 am on Jul 13, 2012 (gmt 0)

Thank you Kendo! Actually, I need the code for my requirement on urgent basis.


5:01 am on Jul 13, 2012 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Hello Anajali, and welcome to the forums.

This is a major coding request to ask for free - and it also goes far beyond HTML, the topic for this forum. If you can't locate a free image uploader script online that will do the job you need, then I think you'd better hire a coder.


5:05 am on Jul 13, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

As long as you have PHP installed on the server, no DLLs would be required.

I'd write the script for you (by modifying one of my existing scripts, actually) but I don't have the time right now. But I found plenty of scripts with a Google search of "image upload script resize". Good luck!


5:41 am on Jul 13, 2012 (gmt 0)

Thank you so much for your replies!

I got my answer!

Thank you again!

Featured Threads

Hot Threads This Week

Hot Threads This Month