Page 1 of 1

Display JSON.txt screen capture

Posted: Mon Jan 06, 2020 2:21 pm
by PFE
I need to save screenshots by pui.download () or by CTRL + F9 in JSON format
I tried to display the JSON file on the screen as indicated in the documentation:
URL  http://ibmi:8080/profoundui/start?jsonU ... screen.txt
I do not get the expected result the message "The requested URL /profoundui/start&jsonURL=/myfile_20191227_json.txt was not found on this server."

I placed the file "myfile_20191227_json.txt" in the directory "\www\profoundxx\htdocs\profoundui\userdata\tmp" on my server
The following URLs give the same error:

http://mysystem:8086/profoundui/start&j ... 7_json.txt
http://mysystem:8086/profoundui/start&j ... 7_json.txt
http://mysystem:8086/profoundui/start&j ... 7_json.txt
http://mysystem:8086/profoundui/start&j ... 7_json.txt
http://mysystem:8086/profoundui/start&j ... 7_json.txt



Should you modify or delete lines in the file such as tags:
"psid": "...",
"HTTP_HOST": "...",

If not, what is the correct way to display the image of the saved screen in a browser?

See attached example myfile_20200106_json.txt.

Re: Display JSON.txt screen capture

Posted: Mon Jan 06, 2020 7:21 pm
by Scott Klement
In your httpd.conf file you should have a directive that looks similar to this:

Code: Select all

DocumentRoot /www/profounduixx/htdocs
Whatever directory is specified there should NOT be in the URL. All URLs (unless there's an Alias/ScriptAlias) will automatically have the DocumentRoot prepended to them. So if you specify jsonURL=/x/y/z it will look for the file in /www/profounduixx/htdocs/x/y/z

You tell us that the file is named /www/profoundxx/htdocs/profoundui/userdata/tmp/myfile_20191227_json.txt (though, you have all the slashes backwards for some reason). Assuming that your DocumentRoot is /www/profoundxx/htdocs that means you should be specifying jsonURL=/profoundui/userdata/tmp/myfile_20191227_json.txt

For some reason, none of the sample URLs you've provided are using that URL. In some cases, you've omitted directories. In some cases you've added extra characters such as . or ~ to the URL. This is why they don't work.

For your second question about psid and/or HTTP_HOST. I don't understand why you would want to change these? What are you trying to accomplish?

Re: Display JSON.txt screen capture

Posted: Tue Jan 07, 2020 2:31 pm
by PFE
Thank you Scott for this information.

The httpd.conf file have a directive : "DocumentRoot /www/profounduixx/htdocs"

I have the files in the directory "…/profoundui/userdata/tmp/"
When I give a URL with the path relative to the "DocumentRoot"
//mysystem:8080/profoundui/start&jsonURL=/profoundui/userdata/tmp/myfile_20200106_json.txt
I get an error message
404 : Not Found
The requested URL /profoundui/start&jsonURL=/profoundui/userdata/tmp/myfile_20200106_json.txt was not found on this server.

The shortened URL: "//mysystem:8080/profoundui/start" start responds well with the LOGIN screen on the server.



The "tmp" directory and the "myfile_20200106_json.txt" file have a "user authorities" at "* PUBLIC and * RWX"
If I go through Visual designer tab "files" the file opens normally in the DESIGNER

Should I complete the configuration of httpd.conf or check a right or something else because I do not get the expected result.

Attached informations :
.
.

Re: Display JSON.txt screen capture

Posted: Tue Jan 07, 2020 2:45 pm
by PFE
Sorry for my previous message.

I found my error in the URL I put a "&" instead of "?" for the first parameter
So we must :

//mysystem:8080/profoundui/start?jsonURL=/profoundui/userdata/tmp/myfile_20200106_json.txt


instead of :

//mysystem:8080/profoundui/start&jsonURL=/profoundui/userdata/tmp/myfile_20200106_json.txt


Thank you again for your help.