0

File resides in the NetSuite file cabinet and needs to be placed on an FTP server each day.

I'm not sure how to handle this via Suitelet/RESTlet, or if it's possible - but would prefer to not use an external source/application.

My current and hopefully temporary workaround is a local scheduled task to run a script to pull files from NetSuite & upload to the FTP.

quarks
  • 33,478
  • 73
  • 290
  • 513
MBrewer
  • 81
  • 2
  • 9

4 Answers4

2

In SuiteScript 2.0, although unsecured FTP is still not support, but SS2.0 has the capability to do SFTP. See http://www.upilioconsulting.com/blog/netsuite-2016-2-sftp-suitescript-2-0/

In SuiteScript 1.0, it's not supported. The workaround is that you'll need to write a middleware code (i.e. in PHP) and let the middleware do the FTP transfer.

Clemen Canaria
  • 133
  • 2
  • 11
1

Netsuite doesn't interact with FTP.

You need a bridge server of some sort that runs a web app (full blown Apache or nginx running PHP or just a simple Node service) Just get a server and install some web server/web service and POST your files to it (nlapiRequestURL with a Scheduled script). Have the web app on the bridge server send the files to the FTP server. If you are using Netsuite you can afford the cost of the bridge server.

bknights
  • 14,408
  • 2
  • 18
  • 31
1

One possible solution is to create a saved search on the Documents to list out all the files in Netsuite filtering by createdate or lastmodifieddate. Create a scheduler to fetch only the new files and save them locally where you want.

Note all the files will be in base64 encoded string format, you need to decode again to obtain the file.

Rockstar
  • 2,228
  • 3
  • 20
  • 39
0

As bknights said NetSuite doesn't support FTP. You need a web server(any server side language can do for that matter, I have written one in Node.js), to receive the files.

The file content for text file will be in Text format, so, no decode logic required for text files. However, binary/pdf/image and other would be in base64 format, as NetSuite's JS has no way of handling binary data. So, make sure you decode it before you create the file on your FTP Server.

prasun
  • 7,073
  • 9
  • 41
  • 59