Skip to main content
udhayak0001
Inspiring
May 24, 2021
Solved

Upload document WEB API

  • May 24, 2021
  • 4 replies
  • 0 views

Is it possible to upload diffrent type of documents in upload document web api. i need to upload pdf ,jpg and png in a single API can anyone help me pls

and can i pass a binary document into an upload document web API?

    Best answer by ranjiths0003

    Hi Udhay,

    Configure Appian-Document-Name Headers like below(don't give file type in value), but you will get the same name as Name for all time.

    here are some results.

    4 replies

    ranjiths0003
    May 24, 2021

    Hi Udhay,

    Yes, you can upload files of a different type in the same API. If you need to restrict files other than pdf and jpg you can do that by file extension check(document(http!request.body, "extension")) and return the response according to the file type uploaded.

    If your question is multiple docs in a single web API call - I guess only one doc is possible on a single go.

    udhayak0001
    Inspiring
    May 24, 2021

    hii ranjith,

    thank you for your response .the problem is i can upload all types of documents but its not taking the correct extension 

    letme tell you an example if im uploading a jpg file means it only uploads the file but not the extension.

    second senario: if i set my default extension as jpg means it converts all the files(pdf,docx,png) which im uploading into jpg format

    is there any default setting which accepts all format?

    ranjiths0003
    May 24, 2021

    Hi Udhay,

    Configure Appian-Document-Name Headers like below(don't give file type in value), but you will get the same name as Name for all time.

    here are some results.