Guest User

Untitled

a guest
Aug 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. Converting between image file types in c#
  2. private void profileImgUpload(HttpPostedFile profileImg)
  3.  
  4. String[] allowedExtensions = { ".png", ".jpeg", ".jpg", ".gif" };
  5. for (int i = 0; i < allowedExtensions.Length; i++)
  6. {
  7. if (FileExtension == allowedExtensions[i])
  8. FileOK = true;
  9. }
  10. }
  11.  
  12. if (FileOK)
  13. profileImg.SaveAs(physicalPath + "newAvatarTemp.png");
Add Comment
Please, Sign In to add comment