11
Web Server - Ask For Help / Api endpoint stream - how?
« Last post by Niels Larsen on May 18, 2025, 10:34:25 PM »Hi
I am developing an endpoint where I have to stream a pdf file (actually I have it as BASE64).
But I need some help to get going with the stream itself.
This is what I have from the associated Swagger:
Can one of you wise heads help me out?
Regards Niels
I am developing an endpoint where I have to stream a pdf file (actually I have it as BASE64).
But I need some help to get going with the stream itself.
This is what I have from the associated Swagger:
Code: [Select]
stream:
type: object
properties:
canRead:
type: boolean
canWrite:
type: boolean
canSeek:
type: boolean
canTimeout:
type: boolean
length:
format: int64
type: integer
position:
format: int64
type: integer
readTimeout:
format: int32
type: integer
writeTimeout:
format: int32
type: integer
Can one of you wise heads help me out?
Regards Niels
12
Web Server - Ask For Help / Re: Call a related table update form
« Last post by Poul Jensen on May 17, 2025, 07:25:08 AM »Hi Ron,
Thanks - that got me going.
Had an issue still getting an Record Not Found error when loading form B, until I added this code in the InitForm Routine:
/Poul
Thanks - that got me going.
Had an issue still getting an Record Not Found error when loading form B, until I added this code in the InitForm Routine:
Code: [Select]
p_web.SetValue('MCus:CUSTOMERNO',p_web.GSV('MCus:CUSTOMERNO'))
/Poul
13
Web Server - Ask For Help / Re: Call a related table update form
« Last post by rjolda on May 16, 2025, 10:18:17 AM »Hi Poul,
Are you going to use a Button to call Table B Update?
On the Button Code - "On CLick" - you can call the Update PROCEDURE for Table B here. You can set any Parameters to pass to Table B on the next line. Lastly the last check box "Include Action" you can check and set the action to Insert, Change as appropriate. That is where I would start.
Ron
Are you going to use a Button to call Table B Update?
On the Button Code - "On CLick" - you can call the Update PROCEDURE for Table B here. You can set any Parameters to pass to Table B on the next line. Lastly the last check box "Include Action" you can check and set the action to Insert, Change as appropriate. That is where I would start.
Ron
14
Web Server - Ask For Help / Call a related table update form (SOLVED)
« Last post by Poul Jensen on May 16, 2025, 03:11:42 AM »Hi,
From a button on the update form of table A, I would like to call the update form of a related table B.
On the button > Client-Side > Send new value to server, I get the record of the related table B (and verifies with debugview++ that it is the correct record) but I have no luck with calling the related update form.
Have tried various variants of code hacked from table B's browse, but without success. See code below:
What am I missing here?
tia
/Poul
From a button on the update form of table A, I would like to call the update form of a related table B.
On the button > Client-Side > Send new value to server, I get the record of the related table B (and verifies with debugview++ that it is the correct record) but I have no luck with calling the related update form.
Have tried various variants of code hacked from table B's browse, but without success. See code below:
Code: [Select]
DO OpenFiles
!Get record of table A
Access:MobSagH.ClearKey(MSagH:KeyGUID)
MSagH:GUID = p_web.GSV('MSagH:GUID')
NOMEMO(MobSagH)
IF Access:MobSagH.TryFetch(MSagH:KeyGUID)
!failed
ELSE
!Get record of table B
Access:MobCustomers.ClearKey(MCus:KeyGUID)
MCus:GUID = MSagH:KundeGUID
NOMEMO(MobCustomers)
IF Access:MobCustomers.TryFetch(MCus:KeyGUID)
!failed
ELSE
ds_outputdebugstring('RET KUNDEN - **OK** MSagH:KundeGUID: ' & MSagH:KundeGUID)
p_web.SSV('MCus:CUSTOMERNO', MCus:CUSTOMERNO)
!This doesn't work
UpdateMobCustomers(p_web,Net:Web:Popup) !Form Procedure
END
END
DO CloseFiles
What am I missing here?
tia
/Poul
15
Web Server - Ask For Help / Re: How to manipulate Camera PHOTO and display it
« Last post by rjolda on May 13, 2025, 12:42:11 PM »Hi,
That code looks like it will do just exactly what I need it to do.
Will check it out.
Thanks,
Ron
That code looks like it will do just exactly what I need it to do.
Will check it out.
Thanks,
Ron
16
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)
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)
17
Web Server - Ask For Help / Re: Avoid downloaded file been served from browser cache
« Last post by Poul Jensen on May 13, 2025, 07:02:50 AM »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
18
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
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
19
Web Server - Ask For Help / Re: Avoid downloaded file been served from browser cache
« Last post by Bruce on May 13, 2025, 06:45:39 AM »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'
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'
20
Web Server - Ask For Help / Re: Avoid downloaded file been served from browser cache
« Last post by Bruce on May 13, 2025, 06:44:16 AM »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
(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