{"id":19967,"date":"2020-06-06T07:31:29","date_gmt":"2020-06-06T07:31:29","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/sagex3\/?p=19967"},"modified":"2020-06-06T07:31:31","modified_gmt":"2020-06-06T07:31:31","slug":"how-to-transfer-file-to-ftp-server","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2020\/06\/06\/how-to-transfer-file-to-ftp-server\/","title":{"rendered":"How to transfer file to FTP server"},"content":{"rendered":"\n<p>Sometimes, it might happen that we need to transfer a file to the FTP server. The below piece of code will transfer the file to FTP.<\/p>\n\n\n\n<p><strong>Parameters:<\/strong><\/p>\n\n\n\n<p><strong>HSTSITE<\/strong>\n<\/p>\n\n\n\n<p>It is the FTP server address on which the\nfiles will be transferred.<\/p>\n\n\n\n<p><strong>HSTUSR\nand HSTPWD<\/strong> <\/p>\n\n\n\n<p>&nbsp;It\nis the Username and Password of the defined FTP server.<\/p>\n\n\n\n<p><strong>HSTWCPPTH<\/strong>\n<\/p>\n\n\n\n<p>&nbsp;It\ns the path of the WinSCP software that we are using to connect to the FTP.<\/p>\n\n\n\n<p><strong>YC_PTHREQ\n<\/strong><\/p>\n\n\n\n<p>&nbsp;It\nis the path of the file that needs to be transferred to the FTP.<\/p>\n\n\n\n<p><strong>PATH<\/strong>\n<\/p>\n\n\n\n<p>&nbsp;It\nis a temporary path at which a bat file will be created which will run\neventually in order to transfer the file to FTP.<\/p>\n\n\n\n<p><strong>WRET(0)<\/strong>\n<\/p>\n\n\n\n<p>&nbsp;It\nis the command to open the FTP.<\/p>\n\n\n\n<p><strong>WRET(1)<\/strong>\n<\/p>\n\n\n\n<p>&nbsp;It\nwill get the Path on FTP where the file will be transferred.<\/p>\n\n\n\n<p><strong>WRET(2)<\/strong>\n<\/p>\n\n\n\n<p>&nbsp;It will get the file that needs to be transferred from its original location i.e. YC_PTHREQ<\/p>\n\n\n\n<p><strong>Working:<\/strong><\/p>\n\n\n\n<p>Now, when you run this piece of code a bat\nfile will be created at the path defined in the variable \u201cPATH\u201d.<\/p>\n\n\n\n<p><strong>Wrseq\nWRET(0)+WRET(1)+WRET(2)+WRET(3)+WRET(4)&nbsp;\nUsing [FACS]<\/strong><\/p>\n\n\n\n<p>This line of code will run the command to\nopen the path on FTP defined in WRET(1) , get the file from its original\nlocation and then transfer it to the FTP and after that close the FTP in the\nbat file.<\/p>\n\n\n\n<p><strong>STAT\n= delFile(PATH+&#8217;\\RGET&#8217; + ZGETTIME + &#8216;.bat&#8217; )<\/strong><\/p>\n\n\n\n<p>This line of code will delete the bat file once the file is transferred to the FTP successfully.<\/p>\n\n\n\n\n\n<p><strong>About Us<\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a> &#8211; a globally\nrecognized Premier Sage Gold Development Partner is a one-stop solution\nprovider for Sage ERP and Sage CRM needs. Being recognized and rewarded for\nmulti-man years of experience, we bring complete end-to-end assistance for your\ntechnical consultations, product customizations, data migration, system\nintegrations, third-party add-on development and implementation expertise.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a>&nbsp;caters to a wide range\nof Sage X3 (Sage Enterprise Management) offerings &#8211; a Sage Business Cloud\nSolution. Our&nbsp;unique GUMU&#x2122; integrations include <a href=\"https:\/\/www.greytrix.com\/product\/sage-crm\/gumu-sage-x3-integration\">Sage X3 for Sage CRM<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/sage-x3\/gumu-x3-salesforce-integration\">Salesforce.com<\/a> and&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/magento-sage-integrations\/sage-x3-magento\">Magento eCommerce<\/a>&nbsp;along with\nImplementation and Technical Support worldwide for <a href=\"https:\/\/www.greytrix.com\/africa\/product\/consulting\/implementation-planning\">Sage X3<\/a> (Sage Enterprise Management). Currently\nwe are <a href=\"https:\/\/www.greytrix.com\/africa\">Sage X3\nImplementation Partner<\/a> in East Africa, Middles East, Australia,\nAsia.&nbsp;We also offer best-in-class&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/erp-development\/sage-x3\">Sage X3 customization and development services<\/a>,&nbsp;integrated applications\nsuch as <a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-integration-services\/pos-system\">POS<\/a> | <a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-integration-services\/warehouse-management-system\">WMS<\/a> | <a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-integration-services\/payment-gateway\">Payment Gateway<\/a> | <a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-integration-services\/shipping-system\">Shipping System<\/a> | <a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-integration-services\/business-intelligence\">Business Intelligence<\/a> | <a href=\"https:\/\/www.greytrix.com\/product\/sage-x3\/ecommerce-magento-integration\">eCommerce<\/a> and have developed\nadd-ons such as <a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-add-ons\/catch-weight\">Catch \u2013 Weight <\/a>&nbsp;and <a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-add-ons\/letter-of-credit\">Letter of Credit<\/a> for Sage X3 to Sage\nbusiness partners, end users and Sage PSG worldwide.<\/p>\n\n\n\n<p>Greytrix is a recognized <a href=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2017\/07\/26\/greytrix-on-boards-sage-global-rockstar-isv-program-with-gumu-for-sage-crm-sage-x3-solution\/\">Sage Rockstar ISV Partner<\/a> for GUMU&#x2122; Sage X3 &#8211; Sage\nCRM integration also listed on <a href=\"https:\/\/www.sage.com\/marketplace\/asb_ListingDetail?listingId=a1h24000007PC3aAAG\" target=\"_blank\" rel=\"noopener\">Sage Marketplace<\/a>; GUMU&#x2122; integration for\nSage X3 &#8211; Salesforce is a 5-star app listed on <a href=\"https:\/\/appexchange.salesforce.com\/listingDetail?listingId=a0N30000000psM5EAI\" target=\"_blank\" rel=\"noopener\">Salesforce AppExchange<\/a>. <\/p>\n\n\n\n<p>For more information on Sage X3 Integration and\nServices, please contact us at&nbsp;<a href=\"mailto:x3@greytrix.com\">x3@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes, it might happen that we need to transfer a file to the FTP server. The below piece of code will transfer the file to FTP. Parameters: HSTSITE It is the FTP server address on which the files will be transferred. HSTUSR and HSTPWD &nbsp;It is the Username and Password of the defined FTP server.\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2020\/06\/06\/how-to-transfer-file-to-ftp-server\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2796],"tags":[],"class_list":["post-19967","post","type-post","status-publish","format-standard","hentry","category-technical"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/19967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/comments?post=19967"}],"version-history":[{"count":1,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/19967\/revisions"}],"predecessor-version":[{"id":19972,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/19967\/revisions\/19972"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=19967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=19967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=19967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}