$url
= ''">https://sandbox.food.ibm.com/ift/api/documents/v1/documents';
$result
= '/IFT/IFT-SAS/token/result_certificate.txt';
rc
= http_url_post_stmf($url
:
tempFile
:
$result
:
HTTP_TIMEOUT
:
HTTP_USERAGENT
:
ContentType );
if
(rc <> 1);
msg = http_error();
dsply msg;
return;
endif;
//
//
delete temp files, we're done
//
unlink($result);
unlink(tempFile);
return;
//==============================================================================
//
Add headers
//==============================================================================
dcl-proc
tripHeaders;
dcl-pi
tripHeaders;
Header varchar(3000);
UserData pointer value;
end-pi;
Header
= 'Accept: application/json'
+ x'0d25'
+ 'Authorization: Bearer ' + %trim(r_json)
+ x'0d25';
end-proc;
In this case I
don't receive the error "No file attached!", but there is something
strange.
In the document
list of the IBM food trust library, I find the document as a title, but
when I try to view the detail and open the PDF file, I don't find the document.
It seems the same
result... that the file was not attached in fact.
Can you help me,
please?
Thank you very
much in advance.
_________________________________________________________
Sara Bellucci
SAS INFORMATICA srl
Tel: +39 075 5058160
Fax: +39 075 5058105
e-mail: SaraBellucci@xxxxxxxxxxxxxxxxx
http://www.sasinformatica.it
Da:
"Scott
Klement" <sk@xxxxxxxxxxxxxxxx>
Per:
SaraBellucci@xxxxxxxxxxxxxxxxx
Data:
16/06/2021
21:15
Oggetto:
Re:
[Ftpapi] In: HTTPAPI - Example 7 - Upload a file from IFS - No file attached!
Hi Sara!
"No File Attached!" is not
coming from HTTPAPI. Most likely, when you send your request to the
HTTP server (REST API or whatever you're calling) it doesn't recognize
the format of the document you're sending. All web services
are different, so it is important to send things in the format that's required
by the specific one that you are calling.
--
Scott Klement
sk@xxxxxxxxxxxxxxxx
On 6/16/2021 5:00 AM, SaraBellucci@xxxxxxxxxxxxxxxxx
wrote:
Hello,
I need to send a PDF file from IFS to a server by calling an IBM webservice.
I saw the EXAMPLE7 of the HTTPAPI tool, and I tryed to use this but I received
the error "No File Attached!".
This is my RPG code to test the upload of a test PDF file:
--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi