PxPlus User Forum

Twitter Twitter Twitter

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - bteixeira

Pages: [1] 2
1
iNomads / File Upload
« on: March 08, 2024, 04:57:18 PM »
Looking into allowing users to upload some files but worried that there seems little control.  Is there any way to limit the files a user can upload based on file type and/or size?  %inomads'upload_file doesn't seem to have any limitations.  I'm planning on saving the file to a directory and run a command line virus scan on it, but it would be better if I could do that on the web server and then move the approved file to the application server after it's been scanned.  Is there any way to put the upload file in the session's tmp directory or something?
Thanks.

2
Programming / Apache HTTP Interface
« on: January 03, 2023, 11:46:20 AM »
The HTTP interface, where you receive a request and are writing to %print_fn with the html (or xml or json or whatever) that you want to return... does it have to be Apache?  In the documentation there's clearly scripting info in a .cgi file to say start PxPlus and runs *plus/apache/pxp_cgi.  Is there anything in there that requires Apache rather than a different web server?  For example, could I have an equivalent script in IIS that runs PxPlus *plus/apache/pxp_cgi and it will forward the web request and return the response to IIS?

3
Language / JSON DIM LOAD
« on: September 15, 2021, 09:44:24 AM »
If I have a JSON array that's basically different records something like:

[{"name":"Alice","type":"A","balance":"123.45"},{"name":"Bob","type":"A","balance":"6543.21","extra-field":"1","extra2":"2"}]

if I do

dim load array${all}=json$

The results are:
array$["1.name"]="Alice"
array$["1.type"]="A"
array$["1.balance"]="123.45"
array$["2.name"]="Bob"
array$["2.type"]="A"
array$["2.balance"]="6543.21"
array$["2.extra-field"]="1"
array$["2.extra2"]="2"

What I'm looking for is a way to get the JSON string of the whole first element.  So something like
array$["1"]="{""name"":""Alice"",""type"":""A"",""balance"":""123.45""}"

Is there a way to do that?

4
iNomads / Communicate with *browser object
« on: May 17, 2021, 10:24:48 AM »
I'm trying to integrate my iNomads application with a third party API.  Using the *browser object, I get an iframe that navigates to the other website where the user can enter data and we get an Ajax response.  I'm able to parse this response and put the data I need into multi-lines on the iNomads page.  What I haven't been able to figure out though is how to post that data back to PxPlus process to use.  If I click into the field and press enter the on it looks like the data for that field gets pushed and the onchange logic fires off.  Is there a way (presumably in javascript) to simulate this or otherwise push the data?

5
Language / Force screen refresh in iNomads
« on: November 18, 2020, 02:05:08 PM »
Is there a way to force a screen refresh in iNomads?  refresh_flg=1 does not seem to do it.  I'm particularly interested in changing the template in code %inomads'template$="newtemplate" and then redrawing the current screen with the new template.

6
Language / *browser and reCAPTCHA
« on: October 21, 2020, 02:22:57 PM »
I'm getting mixed results trying to navigate to sites with a reCAPTCHA using *browser.  I think it might be version based.  I have a client running v14 and the reCAPTCHA won't load but in my office on v16 it does.  Captchas have been around for ages so I'm a little surprised that an older version of *browser wouldn't be able to handle it.  Are you aware of anything that may have changed between versions that would allow reCAPTCHA to start working?  Is there a minimum version for this or a setting to turn on so the old version will display properly?
Thanks,

7
Language / finditemtext$ and load on demand
« on: September 10, 2020, 06:07:49 PM »
Is there a way to get finditemtext$ and load on demand to work at the same time.  Right now it looks like finditemtext will only search loaded rows.

8
Programming / [odb] / [mysql] escape characters
« on: August 13, 2020, 04:21:49 PM »
We have code writing to a database using the [odb] tag.  It works well generally, however at one client, they are using a MySQL server.  MySQL needs backslashes to be escaped (especially at the end of a field where it would end up escaping the quote delimiters).  If using the [odb] tag, a backslash in data is not getting escaped.  Would using the [mysql] tag instead resolve this?  Is there an option or setting that would let us use the [odb] tag still but correctly escape the backslashes?

9
iNomads / iNomads Class for Queries
« on: August 04, 2020, 11:30:28 AM »
I don't see a place to put an iNomads class on query panels.  I at least need a way to distinguish that the panel is a query.
Additionally, is there a way to have query columns auto-size?  The query screen is maximizing to the browser, which is good but the columns stay small and it looks really bad.
Thanks

10
Language / TCP channel, is it alive?
« on: February 11, 2020, 02:53:25 PM »
At one of our clients, we're trying to communicate with a device via TCP but the connection isn't great.  We're having difficulty telling if the device is still working on the command and hasn't replied yet or if the connection has dropped.  The basic code looks like:

write record(tcp_chan)"command goes here"
while 1
read record(tcp_chan,tim=5)resp_segment$
let response$+=resp_segment$
if pos(end_of_message$=response$) then goto *break
wend

If the connection has dropped we want to know as soon as possible and then we can try re-opening the channel, request the last command, prompt the user to reset the device etc.  Without a tim= branch we can sit there way too long.  However the device may legitimately take a long time to process the command, especially if human interaction is involved it could take well over a minute.

Is there a way to determine if the connection has dropped or if the device is just taking a long time to process?

11
Language / DIM (FIND ) and LIKE
« on: October 04, 2019, 09:12:51 AM »
I'm trying to get the first element in an array that contains a substring.  (Preferably without having to do a for loop)
DIM (FIND ) looked promising but it doesn't seem to work with the LIKE comparison.
Is there another way to do this?

12
Language / DUMP GOTO / 'TJ' Parameter
« on: July 31, 2019, 10:42:45 AM »
DUMP GOTO looks like it would be really useful for debugging... but the results I'm getting are basically pages and pages of *winproc... is there another parameter that says don't track jump history in system programs?

13
Programming / Apache HTTP Interface
« on: February 20, 2019, 05:02:24 PM »
I'm looking to implement some web APIs (json or xml).  The Apache HTTP Interface looks to be basically what I need but the setup documentation implies that PxPlus needs to be installed on the Apache server.  Can I use the interface if I want to separate the web server and my application on different boxes?

14
iNomads / File Upload
« on: January 08, 2019, 04:22:46 PM »
Mainly looking for best practices when using the %inomads'upload_file() method.  We want to limit file type and file size on an upload.  We'd also want to scan the file for viruses.  I don't see anything in the inomads documentation that does any of this.  Is there a way to limit file type/size.  Can iNomads integrate with a virus scanner? 

15
Nomads / Grid Arrow Keys
« on: October 12, 2018, 03:10:52 PM »
Is there a way to override the standard arrow key behavior in a grid or at least to trap that an arrow key has been pressed.

Basically what I'm trying to do is if a user presses a down arrow to jump down two rows instead of the standard one.

Pages: [1] 2