× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I'll have to give the QSPRILSP program a shot.

Thanks!

On 11/24/2021 11:58 PM Scott Klement <web400@xxxxxxxxxxxxxxxx> wrote:


Hello Jay,

I believe that when you refer to an "HTTP session", you really mean a
CGI program running under the IBM HTTP Server (Powered by Apache).

The IBM HTTP Server will user the operating system's "profile token"
support to switch userids.  By default, it switches your job from the
QTMHHTTP profile to QTMHHTP1, but this can be changed in the Apache
configuration.  At any rate, whenever a job switches profiles, this
affects spooled files.  This is not specific to the HTTP server, it is
true of ANY job that switches profiles for any reason.  For security
purposes, the current job id is not associated with spooled files, but
instead, a QPRTJOB job is used.

You can learn more about this by reading about the Profile Token APIs,
here:
https://www.ibm.com/docs/en/i/7.4?topic=ssw_ibm_i_74/apis/qsysetpt.htm
(There's similar information under "Profile Handles" as well, since they
work the same way.)   Just look for QPRTJOB in the page to understand
about how spooled files are named with a different job id, you don't
necessarily have to read the entire page.

To solve your dilemna, you can call the Retrieve Identity of Last
Spooled File Created (QSPRILSP) program.  Just call it, and it tells you
the appropriate job id, et al, that you would need to know in order to
use CPYSPLF
https://www.ibm.com/docs/en/i/7.4?topic=ssw_ibm_i_74/apis/QSPRILSP.htm

Alternately, you can eliminate the CPYSPLF and use OVRPRTF instead.

Good Luck

--
Scott Klement
http://www.scottklement.com



On 11/24/21 3:26 PM, Jay wrote:
I am extending an existing application to permit printing directly from the HTTP session.
So far, okay. It prints when it is told to send to a printer.
When I added in the ability to copy the spool file to a PDF file, I run into issues.
The printer file name is okay, but the job is not longer the current job. It's the QPRTJOB session that handled the request.
So, copying the spool file blows up.

Is there a way to capture the actual printer job handling the print request?
I'm expecting it to be 123456/QMHHTTP/username, but I wind up with a spool file in 123456/QPRTJOB/username.


--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.