Upload PDF/DOC/XLSX/XLS/CSV/TXT/PNG/JPEG file formats in Netsuite File Cabinet

Author: Gajanan Karjalkar

In this blog, we will decipher how to upload the various types of file formats like pdf, doc, xlsx, xls, CSV, text, and some image file formats like png and jpeg Netsuite file Cabinet using Netsuite Add File connector.

You can take the file from your respective source system
For demo purpose, I’m taking the file from the local system

  1. Take the required file from the source system
    For example: pdf file

2.) Convert the payload toBase64 format

%dw 2.0

import * from dw::core::Binaries

output application/json

— -

toBase64(payload)

3.) Convert the base 64 value to binary

%dw 2.0

import * from dw::core::Binaries

output application/octet-stream

— -

fromBase64(payload as String) as Binary

4.) In the folder, id section mention the internal id of the folder in which you want to upload the file

%dw 2.0

output application/java

— -

{

internalId: 643

} as Object {

class : “com.mulesoft.connector.netsuite.extension.api.RecordRef”

}

To get the internal id of the folder right click on the specific folder in which you want to upload the file, then in the URL you will get the internal id of the folder.

5.) In the content section, you can mention payload, and in the file name, mention the name of the file along with its extension

6.) Convert the payload into JSON format

NOTE:- While uploading CSV file, make sure you convert it to proper base64 format, other steps remains the same as above

%dw 2.0

import * from dw::core::Binaries

output application/json

— -

toBase64((write(payload,”application/csv”)))

Similarly, you can upload different types of file formats.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

GraphQL Basics.

How to Save Tmux Session * Heru Setiawan

Things no one tells Scrummasters — Data does matter

Image by <a href=”https://pixabay.com/users/mohamed_hassan-5229782/?utm_source=link-attribution&amp;utm_medium=referral&amp;u

Learn Merge Sort In 15 Minutes Or Less

Neku Vault-DeFi 2.0 on Arbitrum

ALLBLOG ABOUT CODING AND CODE

#yeastar is most flexible and programable asterisk based (several awards winning) pabx works with…

how the :not() pseudo-class work

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Apisero

Apisero

More from Medium

Salesforce Dynamic Interactions 🌩️

Heroku Integration Capabilities: The Mini Guide

Subscribe To Salesforce Platform Events With Python

New release: move lead related objects, notification on completed mass lead convert process in…