{"id":29551,"date":"2022-09-06T18:23:52","date_gmt":"2022-09-06T16:23:52","guid":{"rendered":"https:\/\/help.qualiware.it\/qw-help\/?p=29551"},"modified":"2022-09-06T18:23:52","modified_gmt":"2022-09-06T16:23:52","slug":"caricamento-file-su-ftp","status":"publish","type":"post","link":"https:\/\/help.qualiware.it\/qw-help\/caricamento-file-su-ftp\/","title":{"rendered":"Caricamento file su FTP"},"content":{"rendered":"<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">' Il seguente script \u00e8 un esempio di come si pu\u00f2 caricare un file su un server FTP. Pu\u00f2 essere utilizzato semplicemente cambiando i percorsi dei files. \r\n\r\ndim ok as boolean=true\r\ndim msg as string=\"\"\r\ntry\r\n   dim FTP as System.Net.WebClient\r\n   FTP = new System.Net.WebClient\r\n   FTP.Credentials = new System.Net.NetworkCredential (&lt;utente FTP&gt;,&lt;password&gt;)\r\n   Dim responseArray As Byte() = FTP.UploadFile(\"ftp:\/\/&lt;host&gt;\/...\/&lt;nome file&gt;\", &lt;percorso del file da caricare&gt;)\r\n   msg=System.Text.Encoding.ASCII.GetString(responseArray)\r\n   if not empty(msg)\r\n      ok=false\r\n   End If\r\ncatch e as exception\r\n   msg=e.message\r\n   ok=false\r\nEnd try\r\n\r\nif not ok\r\n   form.alert(msg)\r\nelse\r\n   form.alert(\"Invio avvenuto con successo\")\r\nEnd If\r\n\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&#8216; Il seguente script \u00e8 un esempio di come si pu\u00f2 caricare un file su un server FTP. Pu\u00f2 essere utilizzato semplicemente cambiando i percorsi dei files. dim ok as boolean=true dim msg as string=&#8221;&#8221; try dim FTP as System.Net.WebClient FTP = new System.Net.WebClient FTP.Credentials = new System.Net.NetworkCredential (&lt;utente FTP&gt;,&lt;password&gt;) Dim responseArray As Byte() =&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"ngg_post_thumbnail":0,"footnotes":""},"categories":[65],"tags":[71,82],"acf":[],"_links":{"self":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/29551"}],"collection":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/comments?post=29551"}],"version-history":[{"count":1,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/29551\/revisions"}],"predecessor-version":[{"id":29552,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/29551\/revisions\/29552"}],"wp:attachment":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/media?parent=29551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/categories?post=29551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/tags?post=29551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}