Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: GWC/Silverlight and Browsing for Client files(s)  (Read 15824 times)
Scott V.
Posts: 7


« on: January 12, 2012, 09:37:54 pm »

I have some Genero applications that currently run through the GDC, that import files to interface with a financial manangement package also written in Genero. The vendor for our financial package is switching to GWC/Silverlight 2.30, so I guess I will too for my projects.

It looks like I will no longer be able to use a standard file open dialog since ui.Interface.frontCall("standard", "openfile", etc) is not supported in GWC/Silverlight. Is that correct? Will an end user have to put an import file in a hard-coded path, or type a path in an INPUT, etc, instead of being able to browse for a file? Thanks.
Reuben B.
Four Js
Posts: 1047


« Reply #1 on: January 12, 2012, 11:50:58 pm »

Hi Scott,

Have you seen this page of the documentation ...

https://4js.com/online_documentation/fjs-gas-manual-html/User/FileXFerGWC.html

... the issue isn't so much the frontCall but the FGL_GETFILE(), FGL_PUTFILE().  A browser will only allow transfer files to/from the PC the browser is sitting on if the user has explicitly selected the file.   Hence the requirement to use a special widget to do the transfer immediately when the file is selected, the ...

EDIT filename= formonly.filename, STYLE="FileUpload

... which will render a Browse button, user clicks on Browse and explicitly selects a file, and that file is transferred from the Users PC to a temporary directory on the application server.  After that you can use FGL_GETFILE() to move it somewhere permanent on your server.

Hope that helps,

Reuben


Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Scott V.
Posts: 7


« Reply #2 on: January 13, 2012, 03:33:51 pm »

I see, so FGL_GETFILE() references two URLs on the app server, the temp upload file and the ultimate destination. Since the vendor of the financials package is the one that configures the GAS configuration file, I'll have to see if the required configuration changes will be in there already or not. Thanks for your help.
Laurent G.
Four Js
Posts: 110


« Reply #3 on: January 13, 2012, 07:19:24 pm »

Scott,

My name is Laurent Galais from the Services & Support team US & Canada. Please do not hesitate to contact us if you any specific expertise for your Genero package. We can discuss your need and help in the migration to GWC_SL 2.32 process:

https://4js.com/company/where-to-find-us/america#irving

Laurent
Scott V.
Posts: 7


« Reply #4 on: May 09, 2012, 06:54:29 pm »

Now that I'm using the GWC, I'm trying to use the File Upload feature, but I'm not sure I'm doing it right. In the .PER I have an EDIT field with STYLE='FileUpload'. The form displays the Browse button and I can browse for the file. In the .4GL I have an INPUT for for the variable l_initial_path, with an ON ACTION  button that calls FGL_GETFILE() after the file is selected.

If I inspect the variable l_initial_path that is collected by the INPUT after the file is selected, it has only the basename of the file browsed for. E.g. if I browse for 'h:\frost.csv', the variable set by the INPUT has the value 'frost.csv'. I also set the variable l_dest_path for the destination path on the app server, for example 'd:\exportfs\xfr\data\frost.csv'.

When I run FGL_GETFILE(l_initial_path, l_dest_path), nothing gets transferred. I can't even see a file in $FGLASDIR/tmp that was uploaded by the FileUpload widget. Am I supposed to change/add something to the source path returned by the INPUT so that the FGL_GETFILE() works?
Reuben B.
Four Js
Posts: 1047


« Reply #5 on: May 11, 2012, 03:52:55 am »

>If I inspect the variable l_initial_path that is collected by the INPUT after the file is selected, it has only the basename of the file browsed for. E.g. if I browse for 'h:\frost.csv', the variable set by the INPUT has the value 'frost.csv'.

That is correct.

> I can't even see a file in $FGLASDIR/tmp that was uploaded by the FileUpload widget.

Make sure you look before you click on your ON ACTION button that calls FGL_GETFILE().  There is some cleanup mechanism at work so if you are looking after the event, the file may have been removed from FGLASDIR/tmp


Possible traps
- make sure the process running has permissions to write to FGLASDIR/tmp.
- I'd expect a runtime error but with your destination argument passed to FGL_GETFILE, either use Unix style slashes or double-up on the Windows style slashes
- use UNBUFFERED for the INPUT statement.  If the user hasn't moved out of the EDIT with STYLE="Upload" field, l_initial_path won't be populated yet, the value will still be in the buffer.

If in doubt create a small example of what you are doing and post it.




Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Scott V.
Posts: 7


« Reply #6 on: May 11, 2012, 06:38:41 pm »

I got it working! Thanks.
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines