Asp.net (c#)
// This is server path, where application is hosted.
var path = @"C:\Websites\mywebsite\profiles\"; //file in bytes array
var imageBytes = client.DownloadData(imagePath); //file extension
var fileExtension = System.IO.Path.GetExtension(imagePath); //writing(saving) the files on given path. Appending employee id as file name and file extension.
File.WriteAllBytes(path + dataTable.Rows[0]["empid"].ToString() + fileExtension, imageBytes); Next Step:
You may need to Provide access to profile folder for iis user.
- right click on profile folder
- go to security tab
- click "Edit",
- give full control to "IIS_IUSRS" (IF THIS USER NOT EXISTS THEN CLICK ON ADD AND TYPE "IIS_IUSRS" AND CLICK ON "Check Names".