Bineeshcp Viswanath

Bineeshcp Viswanath

  • NA
  • 140
  • 39.3k

How to Retrieve files from Google drive link to website

Apr 27 2019 4:54 AM
Dear All,
I need your help to solve a issue in retreiving a image from google drive folder in my asp.net c# web application.
I want to read byte from the google drive link. How I can achieve that.
Please find the link below:-
https://drive.google.com/file/d/15v_3gHEQ9PTHICUlQiE98ChfgKOijWpD/view?usp=sharing
Here is my code piece for this function:-
byte[] bFile = File.ReadAllBytes(@"https://drive.google.com/file/d/15v_3gHEQ9PTHICUlQiE98ChfgKOijWpD/view?usp=sharing".ToString());
TypeConverter tc = TypeDescriptor.GetConverter(typeof(Bitmap));
Bitmap mybtMp = (Bitmap)tc.ConvertFrom(bFile);
string ImageString = Convert.ToBase64String(bFile);
modal_Img.Src = String.Format("data:image/Bmp;base64,{0}\"", ImageString);
The above code getting the 404 error :-

Answers (3)