Notifications
Clear all

[Solved] How to read files uploded using FileManager in Pipeline?

1 Posts
1 Users
2 Likes
546 Views
0
Topic starter

How to read files in the script node when uploaded using File Manager in Pipeline?

1 Answer
2
Topic starter

The python script below will read the uploaded files. A simple breakdown of the script is below:

  1. Create a Path, with the uploaded file name i.e. :
    uploaded file name: abc.json
    file path = './abc.json'
  2. open the file for read
def executeNode(inputs):
  outputs = {}
  
  # file uploaded to file manager by name 'abc.json'
  upload_file = './abc.json'
  
  # open file for read
  with open(upload_file) as f:
    lines = f.readlines()
    print(lines)

  return outputs

 

This post was modified 1 year ago by Parmod Singh Rana