NetTalk Central

Recent Posts

Pages: 1 ... 4 5 [6] 7 8 ... 10
51
try
    p_web.HeaderDetails.ContentDisposition =  'attachment; filename="'& CLIP(Loc:DownloadFileName) &'"'
    p_web.HeaderDetails.CacheControl = 'no-store, no-cache, must-revalidate, private,post-check=0, pre-check=0, max-age=0'

52
first you need to determine if it's coming from the local client cache, or the server cache.
(Both the browser, like Chrome or Edge) and the NetTalk server can cache files.

There are headers you can set when serving the file to indicate it's uncacheable. (You can google for that if you like, or look in netweb.clw.)
Alternatively you can alter the URL - by adding a random parameter. For example;

capesoft.com\somefile.saf?r=123
is different from
capesoft.com\somefile.saf?r=321

So simple by adding a parameter (which the server happily ignores) with a random value, the client won't get it from cache.
Obviously though it depends on how they are seeing the URL in the first place to download the file.

Cheers
Bruce
53
Web Server - Ask For Help / How to manipulate Camera PHOTO and display it
« Last post by rjolda on May 12, 2025, 05:31:49 AM »
Hi All,
NT 14.21, C11
I am having the users take a photo of a document (e.g. drivers license) on a black background.  Thanks to Charles Edmund and ImageEx, he gave me a routine to remove the background and crop the picture so that I have only the document.  It is all code.  When the user takes a photo, I want to be able to snag it either before display in the NT webcam picture or I could give them a button to "modify it" and display it in another NT webcam picture.  I can save the camera image to disk and manipulate the saved file BUT, I want to grab the image in memory and manipulate it.   The take photo and display it appear to be javascript functions in all.js.
I have not played with javascript so I don't have a clue as to how to go about doing this in Javascript in an elegant fashion.  Basically, ImageEx can import the photo from a Handle of the Global Memory BLock holding the image or from a URL ( or a file on disk). 
So, anyone have any ideas about how to snag this image in memory and send it to Clarion Source code and return it to image in memory for display in the NT webcam field? 
The javascript code seems to be:
                  case 1:  //Take Pic   
            $('#' + id).on('click',function(e){_this.takeSnapshot(e)});
            break;   
and
// Load canvas
$.fn.getCanvasImage = function(type) {
   if (!this[0].toDataURL) {return null;}
   if (type === undefined) {
      type = 'image/png';
   } else {
      type = type
         .replace(/^([a-z]+)$/gi, 'image/$1')
         .replace(/jpg/gi, 'jpeg');
   }
   return this[0].toDataURL(type);
};

Anyone with good javascript skills who can shed some insight and maybe some code to manipulate the image?
Thanks,
Ron

54
Web Server - Ask For Help / Re: How to set file upload filetypes
« Last post by Poul Jensen on May 12, 2025, 12:52:12 AM »
Thanks.

The field "Custom" did it.

/Poul
55
Hi,

Using this to download a file:
Code: [Select]
p_web.HeaderDetails.ContentDisposition =  'attachment; filename="'& CLIP(Loc:DownloadFileName) &'"'
Works fine first time, but if user later downloads same file, it is being served from internet browsers cache, and therefore not the latest version af the file.

How can I avoid this?

tia
/Poul
56
Web Server - Ask For Help / Re: How to set file upload filetypes
« Last post by Niels Larsen on May 12, 2025, 12:17:23 AM »
Maybe this is where you should look.
57
Web Server - Ask For Help / How to set file upload filetypes (SOLVED)
« Last post by Poul Jensen on May 11, 2025, 10:49:39 PM »
Hi,

Where do I set the filetypes for the filepicker used in the File Upload on a NT form?

tia
/Poul
58
Web Server - Ask For Help / Re: Webclient with certificat
« Last post by Jane on May 09, 2025, 04:48:09 PM »
ACK!
Sorry, Niels.  I thought I had edited those question-marks-that-should-be-dashes.

I pasted text from a PDF I did for a ClarionLive webinar some years back and the rogue question marks blossomed. 

Anyway, I hope you got it working.

Cheers,

Jane
59
Web Server - Ask For Help / Re: Webclient with certificat
« Last post by Niels Larsen on May 08, 2025, 11:32:59 PM »
You just made my Friday a great day.
You pointed me in the right direction.
When I couldn't get your commands to work (because I didn't realize that your - was converted to a ?) I found the description at https://www.ssl.com/how-to/export-certificates-private-key-from-pkcs12-file-with-openssl/
What I thought was impossible turned out to be very easy.

THANK YOU Jane!!!
60
Web Server - Ask For Help / Re: Webclient with certificat
« Last post by Jane on May 08, 2025, 08:44:44 PM »
Net demo web client is great for testing.
I don't think you'll be able to make it work with the PFX, though.
A PFX contains both the certificate (with its public key) and your secret private key.  And it's password-protected.

To split apart a PFX for use with NetTalk, use openssl (it's installed automatically with any of your netweb server projects).

When you use openssl, the first private key file you'll get will be password-protected. 
You can also run one more openssl command to produce an unencrypted private key file.

Code: [Select]
Openssl pkcs12 -in MyDomain.pfx -nocerts -out MyDomainEncrypted.key
Openssl rsa -in MyDomainEncrypted.key -out MyUnencryptedDomain.key
Openssl pkcs12 -in MyDomain.pfx -clcerts -nokeys -out MyDomain.crt
Pages: 1 ... 4 5 [6] 7 8 ... 10