NetTalk Central

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.


Messages - JohanR

Pages: 1 [2] 3 4 ... 26
16
Hi Jari

From the BLOB help
If you need to save images to a BLOB, and later restore them to an output file, the type of image should also be saved in the database (JPG, GIF, BMP, etc.).
Using BLOBTOFILE to save to a different extension can produce unpredictable results.

Possible problem is that the original file is PNG, and when the Blob is saved to disk it's a base64 encoded png file.
so you probably need to do some decoding and converting the image to different format.


regards

Johan


17
Hi Jari

I would try to save the image to disk to validate it and debug that way

I did have a quick look, but got a compile error when I tried to add the blobtoimage function

Will have a look later when I have more time

Johan

 

18

Hi,

Embedding a NTWS (Form) in an Iframe on an external website is resulting in the the NTWS page being called continuously.
In checking in with ChatGPT, the proposed answer it seems is add some JS to the NTWS page, see below.

Is this the correct way?
I have not added any JS before,
where and how to add this if this is correct way to do this?

The NTWS will only be used for this embedding purpose.

thanks

Johan




1. JavaScript to Detect Recursive Loading
Add this JavaScript snippet to the managemember page:

javascript
Copy code
if (window.location !== window.parent.location) {
    // Check if the page is loaded within an iframe, then prevent recursive load
    if (window.location.href === window.parent.location.href) {
        window.location = 'about:blank'; // Redirect to blank to stop recursion
    }
}
This code verifies if the managemember page is loaded in an iframe and compares the URL of the iframe with its parent. If they match, it stops further recursive loading by redirecting the iframe to a blank page.

19
Hi,

Found the solution!
Thanks John and the clarionlive team!

What an incredible resource

https://www.youtube.com/watch?v=CVTOUqz1uQ4&t=654s

cheers,
johan


20
Hi,

I am looking to embed A NTWS page on an external website, in this case a WIX hosted site.

And with some help from my ChatGPT, it seems I need to set a CSP on the NTWS, to allow this.

The X-Frame is currently set to "sameorigin" but in order to allow this and the external website as well,
I need to add the external URL and this needs to be done via a CSP.

How and where to set in NTWS?

thanks

Johan







21
Hi Jane

Thank you again for your help and effort,

I used the code and all working fine, hope I have it correct and will test.

The new zipped app does not have any embed code in webhandler, perhaps just zipped the wrong app, unless I'm missing something.
My code and embed point I used.

thanks again,

Johan



p_web._SendFile PROCEDURE(string p_FileName,Long p_header=NET:SendHeader)
! Start of "NetTalk Method Data Section"
! [Priority 1500]
loc:parent  string(252)   ! should always be a lower-case string
loc:done        Long
loc:filename    string(252)
! [Priority 6500]
! End of "NetTalk Method Data Section"

  CODE
  ! Start of "NetTalk Method Executable Code Section"
  ! [Priority 1500]
 
    loc:parent = self.PlainText(Lower(self.GetValue('_parentProc_')))
    loc:filename = SELF.GetPageName(Lower(p_FileName))
 
  ! Start of "Before SendFiles in DLLs"
  ! [Priority 5000]

    !############################# 
          block# = false
          case loc:filename
          of 'nwp_wineshop'
             block# = true
          of 'aboutus'
             block# = true
          of 'nwp_aboutus'
             block# = true
          end !case   
          if block# = true
             p_web.trace('case triggered:' & loc:filename)
             p_web.SendError (404,'The page cannot be found', 'The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.')
             return
          end   
    !############################# 

         
 
  ! End of "Before SendFiles in DLLs"
    loc:done = NetWebDLL_avc_b_SendFile(p_web, loc:Filename, loc:Parent)
    If loc:Done then Return.
    loc:done = NetWebDLL_avcfunc_SendFile(p_web, loc:Filename, loc:Parent)
    If loc:Done then Return.
  ! [Priority 3040]
 
    do Remap:tvcweb
    do CaseStart:tvcweb





22
Hi Jane

thanks!

Unfortunately I'm still on C10, so could not open the example you so kindly created.
It was an idea I had to consider and pursue, and with your suggestion and example it seems like it's a good plan.

Any chance of posting the code and where to pop it in to the webhandler procedure.


thanks

Johan

23
Hi Ron,

Just to add,

There really are 3 situations,

Login required - Pops the login page
Only serve if true - This procedure or page might be embedded on another procedure/page , so if false, send the blank, however it is a valid procedure, but only if certain conditions are met.
Hide - Send "page not found"

Something I have not looked at,
is to add code to serve "page not found" HTML

regards

Johan


24
Hi Ron

Thanks for info and suggestions,
Deleting them not an option,
as some might be work in progress and will be in next release, or some have been taken out of production, but I still want to keep the code in the app.

Yes, chances are that the names won't be guessed, but they can be, especially if they were in production and now have been taken out.

Currently what I am seeing is a blank browser screen, so it looks like a valid URL but with no data.

Ideally would like to display an error msg , "page not found"
So even if the procedure is there, it's invalid and not available




thanks

Johan








25
Hi,

What is a way to make unused web procedures not visible?

My app is full of procedures that are not being used, so I don't want them to be visible.

I have "Login rqd" set to true as well as "Only serve if" = false

anything else to consider?

and I notice that "Login rqd" is available via a global list
anything similar available for "Serve only" ?

thanks

Johan







26
Web Server - Ask For Help / Re: Convert text to HTML text for display
« on: September 26, 2024, 06:32:07 AM »
Hi,

Thanks for your help,
but think I was barking up the wrong tree, something I do way too often nowadays!

Something else is breaking my HTML page

cheers,

Johan


 

27
Web Server - Ask For Help / Re: Convert text to HTML text for display
« on: September 26, 2024, 03:16:12 AM »

Hi,

Thanks, however, I am not displaying / loading this via a NTWS field.
 
I am constructing an HTML file by adding dynamic text to it, and then the server will display a static file.


thanks

Johan




28
Web Server - Ask For Help / Convert text to HTML text for display
« on: September 26, 2024, 02:59:16 AM »

Hi,

If I have a block of text containing all sorts, multiple spaces , quotes etc,
Is there a stringtheory or NTWS function that can be used to to convert that text to display correctly within an HTML document

I am constructing a block of HTML and this text will be included inside <p> tags

thanks

Johan


29
E-Mail - Ask For Help / Postmark issues at the moment
« on: September 16, 2024, 01:02:57 AM »
Hi,

In case anyone using Postmark to send emails via their SMTP server

https://status.postmarkapp.com/notices/5jmmv4cyfqboak2v-service-issue-outbound-smtp-sending-issues

cheers,

Johan

30
Web Server - Ask For Help / Re: Camscanner
« on: August 03, 2024, 01:22:06 AM »
Hi Ron,

Yes, I use it, but as a standalone app, I scan docs to PDF,
then upload a file with 20-50 pages to NTWS,
then split the PDF in the NTWS into separate docs per page and archive into a folder structure with a reference in a tps file to the file on disk.
Works very well.
Camscanner is by far the best doc scanning app I've found, the ease and quality is really good.

cheers,
Johan
 

Pages: 1 [2] 3 4 ... 26