Esempio n. 1
0
 public async Task writeWebp(CanvasRec value)
 {
     foreach (var item in value.frames)
     {
         var    decompressed = LZString.decompressFromUTF16(item.F);
         byte[] data         = Convert.FromBase64String(decompressed);
         var    path         = HttpContext.Current.Server.MapPath("~/Uploads/Webinar/" + value.Token + "/Frames/" + item.name + ".jpg");
         using (FileStream st = new FileStream(path, FileMode.Create))
         {
             await st.WriteAsync(data, 0, data.Length);
         }
     }
 }
Esempio n. 2
0
 // POST api/<controller>
 async public Task Post(CanvasRec value)
 {
     WebpSave wps = new WebpSave();
     await wps.writeWebp(value);
 }