cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Send multiple files from file writer snap to http client snap for a POST rest api call.

Gitanjali
New Contributor II

Send multiple files from multiple file writer snaps to http client snap for a POST rest api call using multipart/form-data.

The files generated by file writer snaps have timestamp in their names which will vary for each run. These files are being written to sldb. I want to pick these files from sldb and pass to http client post for api call. 

If I use multipart type as files and try to pass an expression to read files from sldb path, it does not work. I have tried with type text as well. However if I select type as text and then directly select value from sldb instead of expression it works. But I can't predict the filename due to timestamp in filenames. 

How to achieve that? 

1 ACCEPTED SOLUTION

svatada
Former Employee

@GitanjaliWhen enabling expressions for multipart-form, make sure to prefix the file path with 'sldb:///' when attempting to read the file from the SLDB. I have attached a basic example that utilises the Beeceptor mock HTTP service. For more detailed information, please refer the snap documentation link https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/2614591489/HTTP+Client

View solution in original post

2 REPLIES 2

svatada
Former Employee

@GitanjaliWhen enabling expressions for multipart-form, make sure to prefix the file path with 'sldb:///' when attempting to read the file from the SLDB. I have attached a basic example that utilises the Beeceptor mock HTTP service. For more detailed information, please refer the snap documentation link https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/2614591489/HTTP+Client

Gitanjali
New Contributor II

Hi @svatada ,

Thank you for addressing my query.

I tried the way you suggested. I have progressed one step further.