NetTalk Central

Recent Posts

Pages: 1 ... 4 5 [6] 7 8 ... 10
51
Web Server - Ask For Help / Re: How to manipulate Camera PHOTO and display it
« Last post by osquiabro on May 13, 2025, 08:28:11 AM »
I have a button that rotate a image with ImageEx
 
If ThumbImage.iImage.Load(p_web.GSV('Loc:Path'))
    ThumbImage.iImage.Rotate(90)
    Loc:GuidFoto = st.MakeGuid() 
    ThumbImage.iImage.SaveAs(st.PathOnly(p_web.GSV('Loc:Path'))&'\'& clip(Loc:GuidFoto)&'.'&st.ExtensionOnly(p_web.GSV('Loc:Path')) )
    Loc:Path = st.PathOnly(p_web.GSV('Loc:Path'))&'\'& clip(Loc:GuidFoto)&'.'&st.ExtensionOnly(p_web.GSV('Loc:Path'))
    p_web.ssv('Loc:Path',Loc:Path)
    p_web.SetSessionValue('_save_Loc:Path',Loc:Path) 
    p_web.SaveFileToSession('Loc:Path','Mem:Foto')
   
   
End
loc:st_filename = '/uploads/'&clip(Loc:GuidFoto)&'.'&st.ExtensionOnly(p_web.GSV('Loc:Path'))
p_web.ssv('loc:st_filename',loc:st_filename)
52
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'


Thanks Bruce - this did it.

/Poul
53
Web Server - Ask For Help / Re: How to manipulate Camera PHOTO and display it
« Last post by Bruce on May 13, 2025, 06:48:18 AM »
I think you're over thinking this.
The Take Photo button takes the photo, and sends it to the server.
So you can process it however you like on the server.

The browser really only needs to update the displayed picture after processing.

We can chat in the webinar if you need more ideas.

Cheers
Bruce
54
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'

55
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
56
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

57
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
58
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
59
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.
60
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
Pages: 1 ... 4 5 [6] 7 8 ... 10