[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EXAMPLE2



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>



First we tried to get EXAMPLE16 working, which would take a tracking number,
send it to UPS and get tracking number information back. We insisted on
getting that program to work without knowing all the LPP needed to get
program working.

I already wrote you a message telling you which licpgms you need to get it working. Additionally, the install screen told you which ones you needed when you first installed HTTPAPI.


The message I wrote you is publicly archived at the following address, if for some reason you didn't receive it:
http://www.scottklement.com/archives/ftpapi/200501/msg00013.html



We have now moved to program EXAMPLE2, which is supposed to post some data
to a cgi script.

That sounds like something we need to do at our shop.
Unfortunately, again, the program compiles OK but give us a run time error
of:
Message . . . . :   DSPLY  You do not have permission to create that file

I've already explained this as well. That message can be found here: http://www.scottklement.com/archives/ftpapi/200501/msg00009.html


We would like someone to help us out figure out the error on EXAMPLE2, or
some one that can direct us as to an application example that we can take as
base to develop our own.

Look at the code in example2. You'll see code that looks like the following:


     c                   eval      rc = http_url_post(
     c                             'http://www.scottklement.com/cgi-bin/' +
     c                               'email_comment.cgi':
     c                             %addr(data): %len(%trimr(data)):
     c                             '/testpost.html')

What that's going to do is save the response from the web server in the
filename that was given as the last parameter. In other words, it's
going to be a file called 'testpost.html' that's in the '/' (root) directory of your IFS.


In order to create a file in the root directory, you need to have write authority to that directory. But you don't.

My suggestion is to change the filename to a place that you DO have permission to create a file (or perhaps, overwrite an existing file.)

Perhaps you have authority to the /tmp directory? In that case, you could change the code to something like this:

     c                   eval      rc = http_url_post(
     c                             'http://www.scottklement.com/cgi-bin/' +
     c                               'email_comment.cgi':
     c                             %addr(data): %len(%trimr(data)):
     c                             '/tmp/testpost.html')

See what I did? I added '/tmp' to the last line.

(Also, EXAMPLE2 executes the DSPF command a little further down in the code. You'll have to change the filename there, too.)

You can save your file to ANYWHERE you want in the IFS, as long as you have been granted authority to create stream files in whichever directory you've chosen.

Please don't post the same question again. Try the things that I've suggested above. If they don't work, tell us what doesn't work about them.
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------