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 ... 26
1
Hi Jane

Thanks!
Time to change my spectacles,
my mistake was to click the Deployment option button and assumed that the settings would be correct to deploy, and did not check that page closely enough.

cheers,

Johan

2
Hi,

Can't recall on how to fix this or what is causing it.
I thought it was a check when in Debug mode that it does java script check and if disappears all is well, but I am in Prod mode and suppress errors are clicked on?

Any other settings I've missed?

regards

Johan


3
Hi Ron,

No I have not,
but would like to at some point see if anything can be done, from my design, flow or coding to lessen the Form Re-Submission message.


regards

Johan

4
Hi,

Looked at this topic again to see if I can improve anything to minimise "Form Re-Submissions"
and found this

Is this something that I can implement to see if this will help and how to do that with NTWS?
If it's even possible, and will clicking the back button twice not cause the same problem?


The POST/Redirect/GET Pattern
One common way to avoid the resubmission issue is using a pattern called POST/Redirect/GET. Here's how it works:

Step 1: User submits a form using the POST method.
Step 2: Instead of simply showing the result of the form submission (e.g., a confirmation page), the server redirects the user to a new page (using a 302 redirect).
Step 3: The browser then makes a GET request to the new page, showing the result of the form submission, but this time no form data is being sent.
This way, if the user refreshes the page, it won?t trigger the form resubmission because the browser is just displaying the page after a GET request, not trying to resubmit the form.

Why Use POST/Redirect/GET?
The POST/Redirect/GET pattern is used to:

Avoid Duplicate Submissions: If the user refreshes or goes back to the page, they won?t accidentally submit the same form data again.
Improve User Experience: Users are not confused by a resubmission warning when refreshing or navigating back.
Prevent Unintended Actions: This ensures that critical actions (like payments or orders) are not unintentionally repeated due to a page refresh or navigation.


thanks

Johan


5
The Rest - Ask For Help / Re: Rest API - bad request reply
« on: December 29, 2024, 01:07:28 PM »
Hi Jane

Thanks!!
NetShowSend=>1 did the trick

Could see immediately that I made hash of the lookups in my config file for my header settings, custom header etc...


cheers,

Johan


6
The Rest - Ask For Help / Rest API - bad request reply
« on: December 29, 2024, 03:25:36 AM »
Hi,

In doing a Post to Postmark email API I get the following response.
My JSON data seems to check out OK using a validator.

Is there a way I can save the header of my post?

I know using ThisPage gives me the returned page , header and all, but is there a similar function for the POST?

thanks
Johan



HTTP/1.1 400 Bad Request
Date: Sat, 28 Dec 2024 16:20:00 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 80
Connection: keep-alive
vary: Origin
Strict-Transport-Security: max-age=16000000;

{
  "message":"Bad request",
  "request_id":"fbeaeb7a31e4f17056304f6400604e28"
}

7
Web Server - Ask For Help / Sending mail using Postmark API
« on: December 20, 2024, 02:11:11 AM »
Hi Bruce

Many thanks for your help last night in the NT user group, invaluable sessions,
I certainly learned a few things.

I had one other question about inline images for the HTML body, is using NetEmailSend the only way to do this?
If yes, then my plan was to create a dummy NetEmailSend object, load the HTML string, do the EmbedImages, and then move the HTML string out again with the images embedded.

Postmark has an alternative, in that if the CID is specified in the HTML and the image is on the attachment list,
then it would do the embedding of inline images when the Postmark server processes the email.
But not sure how to handle the CID creation


Any thoughts are appreciated.

thanks
Johan



{
  "From": "sender@example.com",
  "To": "receiver@example.com",
  "Cc": "copied@example.com",
  "Bcc": "blind-copied@example.com",
  "Subject": "Test",
  "Tag": "Invitation",
  "HtmlBody": "<b>Hello</b> <img src=\"cid:image.jpg\"/>",
  "TextBody": "Hello",
  "ReplyTo": "reply@example.com",
  "Headers": [
    {
      "Name": "CUSTOM-HEADER",
      "Value": "value"
    }
  ],
  "TrackOpens": true,
  "TrackLinks": "None",
  "Attachments": [
    {
      "Name": "readme.txt",
      "Content": "dGVzdCBjb250ZW50",
      "ContentType": "text/plain"
    },
    {
      "Name": "report.pdf",
      "Content": "dGVzdCBjb250ZW50",
      "ContentType": "application/octet-stream"
    },
    {
      "Name": "image.jpg",
      "ContentID": "cid:image.jpg",
      "Content": "dGVzdCBjb250ZW50",
      "ContentType": "image/jpeg"
    }
  ],
  "Metadata": {
      "color":"blue",
      "client-id":"12345"
   },
  "MessageStream": "outbound"
}




8
Web Server - Ask For Help / Re: Filter error on compile
« on: December 16, 2024, 09:55:13 PM »
Hi,

Seems to be something to do with the file relationship and how it's setup.
Will report back once I get back to it and solved it
I have typed in a filter for now.

thanks

Johan

9
Web Server - Ask For Help / Filter error on compile
« on: December 16, 2024, 09:19:14 PM »
Hi,

I have received this in the past and could not solve it, lucky for me it was a test browse that I was playing around with and simply deleted it.

Now getting it again, almost as if there is an invalid character there triggering the filter code but then as it's invalid does not generate anything valid?
I have cleaned out the filter fields in the template area.

Any ideas?

thanks

Johan



10
Hi,

I have seen some posts on how to generate favicon and the meta code to include etc..

Is there a guide/webinar/user group episode that shows the options and process to

1) setup a mobile shortcut on a user phone
2) Is there a way to put this in the app stores or make it available from the website after a user has registered



thanks

Johan

11
Web Server - Ask For Help / Re: Cannot run any deployed demo app
« on: November 28, 2024, 12:03:47 AM »
Hi Poul

Not sure where you're seeing the errors or copied the text from.

But easiest for me as follows and not sure if you've done this.

If the page loads , even with errors, then the page is found,
right click on the page in the browser and see the source lines for the script files

eg.
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:r,b" />
<script src="/scripts/modernizr.custom.js" type="text/javascript"></script>
<script src="/scripts/jquery-3.7.0.min.js" type="text/javascript"></script>
<script src="/scripts/jquery-ui-1.13.2.custom.min.js" type="text/javascript"></script>


if you click on the line, it should open the .JS file
otherwise check the location of the file

check your webfolder setting and where the app is loaded from
see attachment

c:\appfolder\webapp.exe

your web folder normally is in the same folder
c:\appfolder\web
and below that the script folder
c:\appfolder\web\scripts



regards

Johan









12


Hi Jari

Some suggestions , sure there are other ways too.

Seeing as you have it in a stringtheory object already, no reason to move to local text field, use the ST methods
Also possibly search for something a bit more specific eg.  data:image/png;base64,

I don't have enough knowledge of image formats ,encoding and you should be searching for,
but you might encounter a different image, with a different starting string, or a random comma, but it's not valid for what you need.
You can then expand on the search string, to other possibilities, if required

              tmp_st.fromblob(ALI:Photo)
              pos# = tmp_st.FindChars('data:image/png;base64,')
              if pos# = 0
                 message('not found')
              else
                 if pos# = 1
                    tmp_st.RemoveFromPosition(pos#,22)
                    tmp_st.Base64Decode()
                   
                    loc:filename = 'c:\tmp\' & random(11111,99999) & '.png'
                    tmp_st.savefile(loc:filename)
                    tmp_st.toblob(ALI:Photo)
                   
                    message('done and saved to:' & loc:filename)
                 else
                    message('possible other issue')
                 end
              end



13
Hi,

Have managed this, however am running into all sorts of other issues when the 2 sites are exchanging information.
Will report back if I make any progress and if the added complication justifies the end result.

cheers,

Johan





14
Hi Bruce

Sorry ,
The loading of the file into a ST object was to try the ST decode,
but I had some issues with saving the file into usbale format.
will check again later and and try to figure out why

Johan

15
Hi Bruce

Yes,

below first few chars from the file that was saved with this code in the desktop program.

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAX

Code in desktop program
loc:filename = 'c:\tmp\' & random(11111,99999) & '.jpg'
IF BLOBTOFILE(ALI:Photo,loc:filename)  !returns an ERRORCODE if copy fails
   MESSAGE('BLOB did not copy due to the following ERRORCODE: ' & ERRORCODE())
else
   tmp_st.loadfile(loc:filename)
   message('saved:') 
END
Copying that to decoding website produces an image file.

Think it needs a few more lines of code to sort it out to display on screen

regards

Johan





I

Pages: [1] 2 3 ... 26