Skip to main content
added 5 characters in body
Source Link
Nico
  • 523
  • 2
  • 10

You need to use the CSOM (Client Object Model) To Download your image.You need to use the CSOM (Client Object Model) To Download your image

Here you use WebClient with this, you loose your sharePoint context, and so your are not connected to sharePoint when want to download image by using : byte[] bytes = wc.DownloadData(siteurl + fileURL);
Try to use methode of the SPFile object, like OpenBinaryStream to get the Byte of your file in a Stream.

You need to use the CSOM (Client Object Model) To Download your image.

Here you use WebClient with this, you loose your sharePoint context, and so your are not connected to sharePoint when want to download image by using : byte[] bytes = wc.DownloadData(siteurl + fileURL);
Try to use methode of the SPFile object, like OpenBinaryStream to get the Byte of your file in a Stream.

You need to use the CSOM (Client Object Model) To Download your image

Here you use WebClient with this, you loose your sharePoint context, and so your are not connected to sharePoint when want to download image by using : byte[] bytes = wc.DownloadData(siteurl + fileURL);
Try to use methode of the SPFile object, like OpenBinaryStream to get the Byte of your file in a Stream.

Source Link
Nico
  • 523
  • 2
  • 10

You need to use the CSOM (Client Object Model) To Download your image.

Here you use WebClient with this, you loose your sharePoint context, and so your are not connected to sharePoint when want to download image by using : byte[] bytes = wc.DownloadData(siteurl + fileURL);
Try to use methode of the SPFile object, like OpenBinaryStream to get the Byte of your file in a Stream.