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.


Topics - jslarve

Pages: [1]
1
Web Server - Ask For Help / Drag & Drop file upload
« on: July 10, 2020, 01:08:44 PM »
If anyone has an idea, I'd appreciate it.

I am interested in creating a web page with a fixed sized grid. Such as 2x4, 4x4, and 8x4.

The user would need to be able to drag a file (or multiple files) to a particular square in the grid (or multiple squares if multiple files).

Dragging a file into a square would initiate file upload. The user would also need to be able to move the file to a different square afterward.

Is there an example I could make use of, or perhaps a commercial script library that can be of use for this?

Thank you.

2
Web Server - Ask For Help / Twilio Webhook for Receiving SMS?
« on: May 22, 2020, 08:01:58 PM »
I'm interested in receiving SMS messages from Twilio.

Wondering if anyone has done this in NetTalk. There's this CSharp example. Looks pretty straightforward, but if anyone has already done this, I'd love to hear whatever advice you might have. https://www.twilio.com/docs/sms/tutorials/how-to-receive-and-reply-csharp

My intent is to display a QR code that I generate, which initiates an SMS message that gets sent to my Twilio number that my web app then receives.

Thank you.

3
This doesn't guarantee that a PNG file is 100% valid, but it gives a few sanity checks before attempting to save and process the file as PNG.

Makes sure that there's a valid PNG header and checks the dimensions to make sure they're in range of your specifications.

This way, the image never needs to hit the disk if it doesn't pass the vetting.

Usage:

MyImageST    StringTheory
MyMessageST StringTheory

   CODE

  !Assuming MyImageST already contains the PNG data

    IF NOT ValidatePNGFile(MyImageST,MyMessageST)
        !Don't bother saving/processing
        MESSAGE('Invalid Image: ' & MyMessageST.GetValue())
    END

ValidatePNGFile      PROCEDURE  (StringTheory pPngContentsST,StringTheory pResultMsgST,|
                            LONG pMinWidth=10,LONG pMaxWidth=1200,LONG pMinHeight=10,LONG pMaxHeight=1200)!,LONG
S                           STRING(4) !4 bytes to be examined as LONG using L.
L                           LONG,OVER(S)
IHDRPos                     LONG !Position of the IHDR chunk
ST                          StringTheory !Utility StringTheory object.

  CODE

    LOOP 1 TIMES     
        pResultMsgST.SetValue('')
        IF pPngContentsST.Slice(1,8) <> '<089h,050h,04Eh,047h,00Dh,00Ah,01Ah,00Ah>'
            pResultMsgST.SetValue('Invalid PNG file')
            BREAK
        END
        IHDRPos = pPngContentsST.Instring('IHDR')
        IF NOT IHDRPos
            pResultMsgST.SetValue('Cannot Determine PNG Dimensions')
            BREAK
        END
       
        S = pPngContentsST.Slice(IHDRPos + 4,IHDRPos + 8 ) !Getting The Width (but it's BigEndian)
        L = ST.SwitchEndian(L)                            !Switch to LittleEndian so we can read it.
        IF L < pMinWidth OR L > pMaxWidth
            pResultMsgST.SetValue('Width is out of Bounds: Value=' & L & ' Minimum=' & pMinWidth & ' Maximum=' & pMaxWidth)
            BREAK
        END
       
        S = pPngContentsST.Slice(IHDRPos + 8,IHDRPos + 12) !Getting The Height (but it's BigEndian)
        L = ST.SwitchEndian(L)                             !Switch to LittleEndian so we can read it.
        IF L < pMinHeight OR L > pMaxHeight
            pResultMsgST.SetValue('Height is out of Bounds: Value=' & L & ' Minimum=' & pMinHeight & ' Maximum=' & pMaxHeight)
            BREAK
        END
        RETURN 1
    END
    RETURN 0

4
I have an API server where you upload an image and it returns a processed image encoded with B64.

It works fine when using SetAccept('xml') on the client. Pretty snappy. The b64 is split up into 75 character lines. Groovy.

When SetAccept('json'), it works fine, but the b64 is returned as one large string (not multi lined).

This makes it impossible for a TEXT control to view it. It just freezes up. I guess that's OK if I can't load in a TEXT control, but I'd like to be able to if possible.

2 Questions:

  • Is using b64 the wrong approach for returning an image? I want to avoid saving the image on disk.
  • Is there a setting to allow the B64 to be split up in the json version?
Thanks.

6
If I run the Chrome task manager and right-click on the list to display the "JavaScript Memory" column, I notice that my app's active tab in Chrome grows continuously. This happens with Clarionshop too.

Is this a bug?

I'll try leaving my browser open over night and see where it ends up.

Thanks

7
Web Server - Ask For Help / NetWebBrowse - Design considerations
« on: October 05, 2016, 02:52:53 PM »
I have a database of line items. There can be multiple prices assigned to a line item via a child table.

(if one record has 2 children, then ALL records will have 2 pricing children in this particular situation)

I would like to dynamically be able to display xx number of pricing columns for xx number of child records.

I have one way that I started to solve, that seems to work okay, but it can get messy. I have a column in my browse, where I dynamically generate xx table structures to go in that column. It seems to work okay. e.g., this might be inside a cell, representing one child record:

This is the kind of thing I'm generating.
<TABLE WIDTH="100%">
  <TR>
     <TH width="30%">M</TH>
     <TH width="30%">L</TH>
     <TH width="30%">E</TH>
   </TR>
   <TR>
       <TD>$33.00</TD>
       <TD>$220.00</TD>
       <TD>$100.00</TD>
   </TR>
</TABLE>

So, in theory, I could put a couple of tables in that cell.

But since I'm early into this project, I'm wondering if there's a "more nettalk" way of doing this. I don't wish to have a bunch of pre-designed hidden columns. There are a whole lot of different cost fields per child record, and depending on the kind of database, we'll display different fields.

Thanks and Best wishes
Jeff Slarve

8
Hello -

I have a NetWebBrowse that has a memory NetWebForm as a child, to the right.
As far as the browse is concerned, the form is unrelated, datawise (if that matters).

When the browse first opened, with records in it, the locator works great.

However, if I enter a string that causes the browse to become empty, the focus moves from the browse locator to one of the fields on the child form.

How do I force the focus of the caret to remain on the locator when the browse gets filtered out?

I hope I've adequately explained the problem.

Thank you,
Jeff Slarve

9
Web Server - Ask For Help / Nettalk Double Drop Menu Problem (Noob alert)
« on: September 14, 2016, 12:22:42 PM »
Hello -

My double drop menus have text underneath that I want to get rid of. Any clues would be much appreciated. See the image in the link below. Thanks.

http://slarve.com/NetTalkMenuProb1.png

Pages: [1]