protected void Page_Load(object sender, EventArgs e) { Response.Expires = -1; try { idIstanza = Request.QueryString["idIstanza"]; tipofirma = Request.QueryString["tipofirma"]; comcomponentType = Request.QueryString["applet"]; if (string.IsNullOrEmpty(tipofirma)) { tipofirma = string.Empty; } if (tipofirma.Equals("cosign")) { firmabool = true; } else { firmabool = false; } byte[] ba = null; if (string.IsNullOrEmpty(comcomponentType)) { ba = Request.BinaryRead(Request.ContentLength); } else { string b64Content = Request["contentFile"]; if (!string.IsNullOrEmpty(b64Content)) { b64Content = b64Content.Replace(' ', '+'); b64Content = b64Content.Trim(); FileJSON file = JsonConvert.DeserializeObject <FileJSON>(b64Content); ba = Convert.FromBase64String(file.content); } } //Invia i dati al servizio wss = new ProxyManager().getProxy(); string result = wss.uploadSignedXml(idIstanza, ba, (WSConservazioneLocale.InfoUtente)Session["infoutCons"], !string.IsNullOrEmpty(comcomponentType)); Session["resultFirma"] = result; //wss.uploadSignedXml(idIstanza, ba, (WSConservazioneLocale.InfoUtente)Session["infoutCons"]); //se l'upload sul servizio avviene con successo restituisco il seguente alert di conferma!!! string confirmMsg = "Il documento firmato e' stato archiviato con successo!"; confirmMsg = confirmMsg.Replace("'", "\\'"); // Visualizzazione messaggio di errore this.RegisterClientScript("UploadSignDoc", "alert('" + confirmMsg + "');"); } catch (Exception es) { Debugger.Write("Errore nell'upload del file firmato: " + es.Message); } }
public static void ReadFishmongerFile() { string jsonPath = $"{FileIO.DirectoryAddress}fishmonger_file.json"; if (!File.Exists(jsonPath)) { fishFile = new FileJSON(); return; } StreamReader readStream = new StreamReader(jsonPath); string line; string wholeText = ""; while ((line = readStream.ReadLine()) != null) { wholeText += $"{line}\n"; } readStream.Close(); fishFile = JsonUtility.FromJson <FileJSON>(wholeText); }
public ActionResult UpdateRemoved(FileJSON filedetail) { return(Json(JsonConvert.SerializeObject(new { Removeditems = filedetail }))); }