If you didn’t run example 1 first that might be the problem. However when I did I got the same result. I have a vague memory that Scott’s turned off the upload page. Maybe because it was being abused.
Michael Mayer-Oakes
Data Scientist
500 Crocker Drive. Vacaville, CA. 95688
Phone: 707-452-2868 | www.mariani.com

Celebrating over 100 years of being your Global Supplier of Dried Fruits and Snacks.
Please consider the environment before printing this email.
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx>
On Behalf Of SaraBellucci@xxxxxxxxxxxxxxxxx
Sent: Wednesday, June 16, 2021 3:01 AM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: [Ftpapi] In: HTTPAPI - Example 7 - Upload a file from IFS - No file attached!
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:
**free
ctl-opt dftactgrp(*no) bnddir('HTTPAPI');
/copy HTTPAPI_H
/copy IFSIO_H
dcl-s tempFile varchar(40);
dcl-s form pointer;
dcl-s type char(64);
dcl-s rc int(10);
tempFile = http_tempfile();
form = http_mfd_encoder_open(tempFile: type);
http_mfd_encoder_addvar_s(form: 'operation' : 'VERIFY');
http_mfd_encoder_addvar_s(form: 'data_format': 'PDF' );
http_mfd_encoder_addstmf( form
: 'handout'
: '/IFS_Path/Test.pdf'
: 'application/pdf' );
http_mfd_encoder_close(form);
rc = http_url_post_stmf( 'http://www.scottklement.com/httpapi'
+ '/upload.php'
: tempFile
: '/IFS_Path/http_result.txt'
: HTTP_TIMEOUT
: HTTP_USERAGENT
: type );
unlink(tempFile);
// handle any errors during post here... etc..
if rc <> 1;
http_crash();
endif;
*inlr = *on;
Someone can help me?
Thanks in advance.
_________________________________________________________
Sara Bellucci
SAS INFORMATICA srl
Tel: +39 075 5058160
Fax: +39 075 5058105
e-mail: SaraBellucci@xxxxxxxxxxxxxxxxx
http://www.sasinformatica.it