Skip to main content
[Edit removed during grace period]
Source Link
Source Link

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.

  1. right click on profile folder
  2. go to security tab
  3. click "Edit",
  4. give full control to "IIS_IUSRS" (IF THIS USER NOT EXISTS THEN CLICK ON ADD AND TYPE "IIS_IUSRS" AND CLICK ON "Check Names".