Click here to Skip to main content
15,178,226 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i upload images into different folders based on their(images)sizes.

Thank you ,
Sandeep Mewara 21-Feb-11 3:17am
You need to write a code! Get the size, put an if-else and save it in preconfigured folders. Whats the issue?

1 solution

You can check FileUpload.PostedFile.ContentLength and based on that, you can save the posted file in specific directory using FileUpload.PostedFile.SaveAs.
lakshmanriz 21-Feb-11 7:07am
i want to save the images into different folders based on their dimensions.
if any one uploads 1024 X 720 image it has to be saved in one folder
if it is of 500 X 500 images it has to be stored in another folder
like so.....
Prerak Patel 21-Feb-11 7:19am
myImage = System.Drawing.Image.FromStream(FileUpload1.PostedFile.InputStream)
and then you can check myImage.Height and myImage.Width and decide where to place it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900