rainit2006 / Certifications

0 stars 0 forks source link

how to send Mysql Blob image to Amazon s3 using C# #4

Open maketest opened 6 years ago

maketest commented 6 years ago

i want to get the image(blob) from mysql database and then send it to amazon s3 using C#..here i can not use file path since i am using database blob image.kindly help me to place the image amazon s3 using putobject or any other ways

string sql = "SELECT visitor_image FROM aws"; MySqlCommand cmd = new MySqlCommand(sql, conn); MySqlDataReader myData = cmd.ExecuteReader() myData.Read();

to set it to

PutObjectRequest request = new PutObjectRequest { BucketName = "BucketName", Key = "demo3.txt", //ContentBody = "Hello World!", FilePath = @"D:\demo.txt", ContentType = "image/jpeg" InputStream };;