Dr.Ajay Kashyap

Dr.Ajay Kashyap

  • NA
  • 521
  • 284.3k

How to Change Image extensions In MVC

Dec 12 2016 2:43 AM
Hello Friends ...
 
How To Change Image extensions When User Uploading Image In Mvc....
I am Using ImageReSizer nuget Package Manage.
 
Given Below Is My Code:-
public static string UploadFile(HttpPostedFileBase file,string file_Name,int height,int width)
{
var path = Path.Combine(HttpContext.Current.Request.MapPath(UploadPath), file_Name);
file.SaveAs(path);
ResizeSettings resizeSetting = new ResizeSettings
{
Width = width,
Height = height,
Format = "."
};
ImageBuilder.Current.Build(file, path, resizeSetting);
return file_Name;
}
 

Answers (10)