Upload PDF from Xano to external

Options

Hi,

I've been working on posting a file for a while now. What's the goal? We retrieve a PDF file from an external system. This file then needs to be posted to another system.
Retrieving the PDF is not a problem, and saving the file in Xano works fine as well. However, the challenge comes when we need to send it to another system using an API POST request. I've tried different methods, such as saving it in Xano first and then sending it, but I'm also open to a method that doesn't require saving the file (which is actually preferred).

In Postman, I can achieve the file posting successfully. However, when I import the cURL into Xano, it doesn't work as expected. It's probably related to how the file should be set in the request body, but unfortunately, I haven't been able to figure it out.

Here are some screenshots from Postman to illustrate the process. I hope someone can assist in understanding the correct approach for sending the file via Xano.

curl 'https://XXXXXX.resttest.afas.online/ProfitRestServices/fileconnector/KnSubject/687678.pdf' --header 'Authorization: AfasToken' --form 'untitleeeed=@"/Volumes/home/Download_shared/Untitled 2.pdf"'

Thank you in advance for your help!"

Tagged:

Best Answer

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Answer ✓
    Options

    I think this is what you are looking for: https://docs.xano.com/working-with-data/functions/external-api-request#multipart-support

Answers