31
Web Server - Ask For Help / Re: Api endpoint stream - how?
« Last post by Bruce on May 22, 2025, 07:01:32 PM »Hi Niels,
>> I have some static ftp files that I need to expose via a REST api.
are you over thinking this?
It sounds to me like you just put the static file in the web folder (or sub folder), then the client can just GET it (ie use a regular WebClient to Fetch the file.)
I'm not sure this needs to be in an API?
But assuming it does need to be an API;
Add a StringTheory object to the RETURNS tab of the API.
Put your file in there (probably Base64 encoded.)
>> I'm aware that I can BASE64 encode them but the client would prefer them as "files".
Hence my suggestion above that this is just a regular GET.
If you want more control, then check out the FileDownload (40) example. That has a generic "ServeDocument" procedure in the app for serving files.
An API method will return a JSON or XML response - and of course any binary in there would need to be appropriately encoded at the very least for Json or XML.
I recommend Base64 because that's easier.
Cheers
Bruce
Cheers
Bruce
>> I have some static ftp files that I need to expose via a REST api.
are you over thinking this?
It sounds to me like you just put the static file in the web folder (or sub folder), then the client can just GET it (ie use a regular WebClient to Fetch the file.)
I'm not sure this needs to be in an API?
But assuming it does need to be an API;
Add a StringTheory object to the RETURNS tab of the API.
Put your file in there (probably Base64 encoded.)
>> I'm aware that I can BASE64 encode them but the client would prefer them as "files".
Hence my suggestion above that this is just a regular GET.
If you want more control, then check out the FileDownload (40) example. That has a generic "ServeDocument" procedure in the app for serving files.
An API method will return a JSON or XML response - and of course any binary in there would need to be appropriately encoded at the very least for Json or XML.
I recommend Base64 because that's easier.
Cheers
Bruce
Cheers
Bruce
32
Web Server - Ask For Help / Re: Refresh NWB Header
« Last post by rupertvz on May 22, 2025, 01:22:22 PM »Thank you Osquiabro,
I've tried what you've suggested, but the memory-form does not seem to get focus - after a record is added in the NWB under the memory-form.
Thus GotFocusBack embed is not firing. Any ideas?
I've tried what you've suggested, but the memory-form does not seem to get focus - after a record is added in the NWB under the memory-form.
Thus GotFocusBack embed is not firing. Any ideas?
33
Web Server - Ask For Help / Re: Hide Webcam after photo is taken - SOLVED
« Last post by rjolda on May 22, 2025, 07:45:05 AM »HI
With Bruce's help I found out that the TakePicture button is dedicated to javascript which runs and WILL NOT SEND a value to the server.
By putting the hide condition and then the refresh fields in the WEBCAM field! That was the trick.
Ron
With Bruce's help I found out that the TakePicture button is dedicated to javascript which runs and WILL NOT SEND a value to the server.
By putting the hide condition and then the refresh fields in the WEBCAM field! That was the trick.
Ron
34
Web Server - Ask For Help / Re: Api endpoint stream - how?
« Last post by Alberto on May 22, 2025, 05:04:27 AM »Hi, May be copy your ftp files to a folder inside your web folder and create an API method to provide the ftp file link?
35
Web Server - Ask For Help / Re: Api endpoint stream - how?
« Last post by urayoan on May 22, 2025, 04:47:30 AM »Hi Neil
And why not read the file, convert to base64 for transfer purposes and then decode and save it in the format the client want?
And why not read the file, convert to base64 for transfer purposes and then decode and save it in the format the client want?
36
Web Server - Ask For Help / Re: Hide Webcam after photo is taken
« Last post by rjolda on May 22, 2025, 02:06:17 AM »Hi Bruce,
My Webcam field (equate AON:ThisPicture) has the following hide statement:
Hide if Clarion: p_web.GSV('PhotoDone') ='YES'
I have the AON:ThisPicture value in the Reset box for TakePhoto button. The Take Photo button also sets: p_web.SSV('PhotoDone') ='YES')
Ron
My Webcam field (equate AON:ThisPicture) has the following hide statement:
Hide if Clarion: p_web.GSV('PhotoDone') ='YES'
I have the AON:ThisPicture value in the Reset box for TakePhoto button. The Take Photo button also sets: p_web.SSV('PhotoDone') ='YES')
Ron
37
Web Server - Ask For Help / Re: Api endpoint stream - how?
« Last post by Niels Larsen on May 22, 2025, 12:16:50 AM »I can see that it doesn't really make sense.
I'll try to make it a little clearer.
I have some static ftp files that I need to expose via a REST api.
I'm aware that I can BASE64 encode them but the client would prefer them as "files". This is where I'm a bit confused how to.
/Niels
I'll try to make it a little clearer.
I have some static ftp files that I need to expose via a REST api.
I'm aware that I can BASE64 encode them but the client would prefer them as "files". This is where I'm a bit confused how to.
/Niels
38
Web Server - Ask For Help / Re: Hide Webcam after photo is taken
« Last post by Bruce on May 21, 2025, 05:52:31 PM »>> as if the webcam is set to ALWAYS display no matter what the programmer (like me) is trying to do.
*how* are you trying to make it "not display" ?
*how* are you trying to make it "not display" ?
39
Web Server - Ask For Help / Re: Hide Webcam after photo is taken
« Last post by rjolda on May 21, 2025, 03:08:06 PM »Yes, I am refreshing it.
Ron
Ron
40
Web Server - Ask For Help / Re: Hide Webcam after photo is taken
« Last post by Alberto on May 21, 2025, 12:50:33 PM »Hi, are you refreshing the AON:ThisPicture control when pressing the TakePhoto Button?