Exemple #1
0
        public string ProfilePicUploader(HttpPostedFileBase uploadedFile, string memberId)
        {
            string filePath = string.Empty;

            if (uploadedFile != null)
            {
                string Filename = uploadedFile.FileName;
                string path     = Server.MapPath("~/ProfilePic/");
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }

                filePath = path + Path.GetFileName(uploadedFile.FileName);
                string extension = Path.GetExtension(uploadedFile.FileName);
                uploadedFile.SaveAs(filePath);
                var response = _memberServices.UpdateProfilePic(Filename, memberId);
                return(response);
            }
            return("null");
        }