Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
how to resize image and save into folder when uploading image in fileupload control using C#.
Posted

Refer this link to answer you question

How can I check the size of the images before uploadnig ?[^]

This link answers you to save image into a folder.
http://www.aspdotnet-suresh.com/2011/03/how-to-save-images-into-folder-and.html[^]
 
Share this answer
 
v2
If you're working with ASP.NET Web Pages, Web Forms or MVC no matter what type of technology you're using. You can use the WebImage object and work with it.

It has many built-in functions that you can use, to resize or to do what so ever you want to do.

http://www.asp.net/web-pages/tutorials/files,-images,-and-media/9-working-with-images[^] Use this link, to learn this from the official ASP.NET website.

.. or you can learn it from the MSDN : http://msdn.microsoft.com/en-us/library/system.web.helpers.webimage(v=vs.111).aspx[^]

Sample code to deal with it is as:

C#
// get the image from the request and work with it.
var photo = new WebImage().GetImageFromRequest();
// this code below does the job of resizing.
photo.Resize(width: 60, height: 60, preserveAspectRatio: true,
               preventEnlarge: true);


Also remember, FileUpload control in the ASP.NET Web Pages NuGet helper also converts the entire code to the HTML code.
 
Share this answer
 
v2
 
Share this answer
 

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