jeudi 23 avril 2020

How to Download the file or get the file contents from the dynamic URLs?

I am using a simple GET request to Get the different files

Say, I want to get the input file

https://localhost/api/getfile?Inputfile="???"

similarly, if I want to get the output file

https://localhost/api/getfile?outputfile="???"

Yeah it's true that I can directly get the input and output file and file contents from the URL like

https://some-cloud-storage.com/folder/myInputFile.txt

I can just GET Request to the above URL but the Automation ERP System need a GET API call which is able the handle the dynamic URLs and also to prepare the file contents in standard representable format

so can anyone just suggest me how to design such GET API Request so that I will be able to pass dynamic URL to it and get the file contents in a standard format?

Note: input/output file location can be on cloud so a cloud URL like this

https://some-cloud-storage.com/folder/myInputFile.txt

or

the file can be found on on-premise like below

UNC Network path //storage/folder/file.txt or C:\folder\file.txt

please guide me to design an API which is flexible enough in the single GET request to get input or output file in a single call from all these versatile locations.

Aucun commentaire:

Enregistrer un commentaire