if I want to download a document from a server with Spiderbasic, I always have to use
Code: Select all
Procedure RunProgram(Filename.s, Parameter.s = "")
! if (v_parameter != "") {
! var win = window.open(v_filename, v_parameter);
! win.focus();
! } else {
! window.open(v_filename);
! }
EndProcedure
RunProgram ("https:/myServer.org/cgi-bin/cgi.exe?0=CreatePDF", "")
The Result.s contains the PDF. But how can I save this?
Code: Select all
Procedure CGI_CreatePDFCallback(success, Result.s)
If CreateFile(0, "myDocument.pdf", 0)
WriteString(0, Result)
ExportFile(0, "application/pdf", #PB_LocalFile)
CloseFile(0)
EndIf
EndProcedure
I must be using WriteData(). But how do I get Result.s into an allocated memory?
Can anyone help me?