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: FileUpload style deprecated  (Read 6334 times)
Paul M.
Posts: 13


« on: May 11, 2022, 11:30:37 pm »

Just upgraded our Dev servers to GAS 3.20.15 and the GBC is complaining the "Style=FileUpload has been deprecated Use fgl_getfile().  We use fgl_getfile after we get the windows file location using the input from the edit box.

I am wondering if there is a work around for this process or whether my thinking is still in version 2.X.   

Gary C.
Posts: 109


« Reply #1 on: May 12, 2022, 02:56:00 pm »

There's no workaround that I am aware of.

We use a button edit in the form:

Code
  1. buttonedit f002 = formonly.file_src,required,not null,image="DownloadFolder",action=uploadfile;

and the corresponding action will be along the lines of, with some error handling of course:

Code
  1.        on action uploadfile
  2.            call ui.Interface.frontCall("standard", "openfile", ["", %"Excel Files", "*.xlsx", %"Upload File"], file_src)
  3.            if file_src is not null then
  4.                call fgl_getfile(file_src, file_dst)
  5.            end if
Reuben B.
Four Js
Posts: 1049


« Reply #2 on: May 16, 2022, 10:47:39 am »

There is a page in the 3.0X GAS docs that explain this.   That page does not appear in 3.1X or later docs and it probably should, I have asked for it to be reinstated.

Gary has it right.  There needs to be an openFile front-call followed by FGL_GETFILE.  This is the cross platform solution for all front-ends, rather than having IF gdc do this ELSE IF Web do something different.

Essentially in a browser environment, you cannot have a standalone FGL_GETFILE(source filename, destination filename) where the source filename variable is coded by the developer without any user input.  For instance the equivalent of FGL_GETFILE("/etc/hosts",...), FGL_GETFILE("C:/<guess>/password.txt",...) etc, browsers simply do not allow to happen .  You have to force the user to choose a file via the openFile frontcall.  FGL_GETFILE then puts the chosen file in the desired destination.

Reuben




Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines