BBjFileOpen
                                            In BBj 25.03 and higher, the BBjFileOpen object is equivalent to the FILEOPEN() Function - Create File Open Dialog.
                                            Creation
                                            BBjAPI > BBjFileOpen
                                            The BBjFileOpen object is created through the following BBjAPI method:
                                            
                                                
                                                
                                                
                                                    
                                                        | Return Value | 
                                                        Method | 
                                                    
                                                
                                                
                                                    
                                                        | BBjFileOpen | 
                                                        fileopen()
 | 
                                                    
                                                
                                            
                                            Methods of BBjFileOpen
                                            
                                                
                                                
                                                
                                                    
                                                        | Return Value | 
                                                        Method | 
                                                    
                                                
                                                
                                                    
                                                        | BBjFileOpen | 
                                                        ext(String ext)
 | 
                                                    
                                                    
                                                        | BBjFileOpen | 
                                                        filters(String filters)
 | 
                                                    
                                                    
                                                        | BBjFileOpen | 
                                                        mode(int mode)
 | 
                                                    
                                                    
                                                        | BBjFileOpen | 
                                                        modes(String modes)
 | 
                                                    
                                                    
                                                        | BBjFileOpen | 
                                                        name(String name) | 
                                                    
                                                    
                                                        | BBjFileOpen | 
                                                        path(String path)
 | 
                                                    
                                                    
                                                        String
                                                         | 
                                                        show()
 | 
                                                    
                                                    
                                                        | BBjFileOpen | 
                                                        title(String title)
 | 
                                                    
                                                
                                            
                                            Constants
                                            
                                                
                                                
                                                
                                                
                                                    
                                                        | Value | 
                                                        BBjFileOpen Constant
 | 
                                                        Icon | 
                                                    
                                                
                                                
                                                    
                                                        | 0
                                                         | 
                                                        FILEOPEN_SELECT_FILE
 | 
                                                        Only files may be selected (default)
 | 
                                                    
                                                    
                                                        | 1
                                                         | 
                                                        FILEOPEN_SELECT_DIRECTORY | 
                                                        Only directories may be selected
 | 
                                                    
                                                    
                                                        | 2
                                                         | 
                                                        FILEOPEN_SELECT_FILE_OR_DIRECTORY | 
                                                        Files or directories may be selected
 | 
                                                    
                                                
                                            
                                            Example
                                            
                                                
                                                    rem ' bbjapi-clientfile.txt
precision 6
tc! = bbjapi().getThinClient()
fs! = tc!.getClientFileSystem()
filter$ = ""
filter$ = filter$ + "Text Files (*.txt)"+$0a$+"*.txt"+$0a$
filter$ = filter$ + "HTML Files (*.htm;*.html)"+$0a$+"*.htm;*.html"+$0a$
filter$ = filter$ + "Image Files (*.png;*.jpg;*.jpeg;*.bmp;*.gif)"+$0a$+"*.png;*.jpg;*.jpeg;*.bmp;*.gif"+$0a$
filter$ = filter$ + "All Files (*.*)"+$0a$+"*.*"+$0a$
i = bbjapi().msgbox().message("Test client fileopen + copy file from client to server").modes("theme=info").show()
clientfile$ = bbjapi().fileopen().title("Pick a client file").filters(filter$).modes("client,theme=primary").show()
i = bbjapi().msgbox().message(clientfile$).title("Selected client file").modes("theme=info").show()
if pos("::"=clientfile$) then goto eoj
cf! = fs!.getClientFile(clientfile$)
i = bbjapi().msgbox().message("Copy "+clientfile$+" to the server").modes("theme=primary").show()
t = tim
serverfile$ = cf!.copyFromClient()
t = tim - t
t = t * 3600
serverfile = unt
open (serverfile)serverfile$
serverfile$ = fid(serverfile)(9)
bytes = dec(fin(serverfile)(1,4))
close (serverfile)
i = bbjapi().msgbox().message("Copied client file "+clientfile$+" to server file "+serverfile$+" ("+str(bytes)+" bytes; "+str(t)+" seconds)").title("Copied from client to server").modes("theme=primary").show()
i = bbjapi().msgbox().message("Test server fileopen + copy file from server to client").modes("theme=info").show()
serverfile$ = bbjapi().fileopen().title("Pick a server file").filters(filter$).modes("theme=primary,sort=+name").show()
i = bbjapi().msgbox().message(serverfile$).title("Selected server file").modes("theme=info").show()
if pos("::"=serverfile$) then goto eoj
clientfile! = new java.io.File(serverfile$)
clientfile$ = clientfile!.getName()
clientfile$ = bbjapi().filesave().title("Save to client").name(clientfile$).filters(filter$).modes("client,theme=primary").show()
if pos("::"=clientfile$) then goto eoj
i = bbjapi().msgbox().message("Copy server file "+serverfile$+" to client file "+clientfile$).modes("theme=primary").show()
cf! = fs!.getClientFile(clientfile$)
rem ' To immediately delete the ClientFile from the server-side cache after copying it to the browser client, add this to BBj.properties:
rem ' com.basis.bbj.web.file.FileDownloadServlet.autoDelete=true
cf!.copyToClient(serverfile$)
i = bbjapi().msgbox().message("Copied server file "+serverfile$+" to client file "+clientfile$).title("Copied from server to client").modes("theme=success").show()
eoj:
release 
                                                     | 
                                                
                                            
                                            See Also
                                            BBjAPI
                                            
                                            BBjAPI - Fileopen
                                            
                                            FILEOPEN() Function - Create File Open Dialog
                                            
                                            See the BBj Object Diagram for an illustration of the relationship between BBj Objects.