Guest User

Untitled

a guest
Apr 16th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. [WebMethod]
  2. [ScriptMethod(UseHttpGet = false, ResponseFormat = ResponseFormat.Json)]
  3. [PrincipalPermission(SecurityAction.Demand, Role = "Users")]
  4. public void UploadThumbnail(long jobId, string reference, string iconData) {
  5.  
  6. byte[] b = Convert.FromBase64String(iconData);
  7.  
  8. System.IO.FileStream fs = new System.IO.FileStream(Server.MapPath("/thumbnails/test.jpg"), System.IO.FileMode.CreateNew);
  9. System.IO.BinaryWriter w = new System.IO.BinaryWriter(fs);
  10.  
  11. for(int i=0;i<b.Length;i++) {
  12. w.Write(b[i]);
  13. }
  14. w.Close();
  15. fs.Close();
  16. }
Add Comment
Please, Sign In to add comment