O4WDownload () (OpenInsight 32-bit)
At 15 JUN 2021 01:30:32PM BrianWick wrote:
Hi Folks-
OI 9.4.6
Is there a place where I can find examples and a bit more docs on how to use O4WDownload ?
tx
At 15 JUN 2021 06:31PM Barry Stevens wrote:
Hi Folks-
OI 9.4.6
Is there a place where I can find examples and a bit more docs on how to use O4WDownload ?
tx
I assume you have looked here besides the "212-986 O4W 9.3.1 Reference Guide.pdf" in …/Documents
At 17 JUN 2021 08:34PM BrianWick wrote:
this does not give much info prompting my question:
O4WDownload(<filename>, <contentType>, <content>, <suggestedFilename>, <newWindowName>, <keepFile>)
Generates a file download with the contents contained in <content>, or (if not specified) from <filename>. <filename> can be an os file, or an OI file (in the form <table>" "<itemID>). <suggestedFileName> is the name to show as the "Save as..." on the download; if not specified, it is <filename>. If <contentType> is not specified, it is determined from <suggestedFilename>/<filename>, if possible. If <newWindowName> is specified, and this is generated during an O4W "response", then a new browser window will be opened for the response. If <keepFile> is set to "1", the file (if any) is not removed after this call (by default, O4WDownload will remove the file after downloading). O4W toolkit applications should return after the O4WDownload call, as no other content can be returned. If suggestedFileName parameter is null (“”), then the downloaded item will attempt to be opened in the current browser page, and not as an attachment.Any examples or clarification of ContentType for example
At 18 JUN 2021 07:37AM D Harmacek wrote:
Noting that this command is a connector between OI and a browser I suggest you do a search on "browser contenttype" for clues.
The content type is specified in the html header to give the browser a clue about the content so it can be rendered. So, O4WDownload nicely includes a Content-Type header argument. You can specify it in the argument <contentType>, or if empty, O4W will try to guess. A good guess about a file named download.pdf filename would be "application/pdf". I found an an example and list here https://stackoverflow.com/questions/23714383/what-are-all-the-possible-values-for-http-content-type-header
Dave Harmacek - Harmacek Database Systems - near Boston, MA USA
At 18 JUN 2021 09:07AM BrianWick wrote:
Hi Dave -
I am not sure I am looking at the right command.
In my world the user can build a select which can be put into a my picker routine or displayed as a scroll in a data entry screen.
A third option I want to add is to download the results as a CSV.
In Windows the default file location is "C:\users\(username)\Downloads\" …so how do I determine the local username so I can write the CSV there.
How would I do the same thing in a mobile environment ?
I know I saw something maybe that O4WPopup or some kind a reporter command could create a CSV and write it somewhere ?
tx.