Rocket U2 | UniVerse & UniData

 View Only
Expand all | Collapse all

Having Windows Application automatically open a file when uploaded from UV to end-user PC.

  • 1.  Having Windows Application automatically open a file when uploaded from UV to end-user PC.

    Posted 02-19-2024 10:20

    The process is simple - create a report on the UV side, upload and open the file in Windows after the upload is complete.  I've gotten as far as windows detects a new file, but how can I trigger an app to start and open the new file? 



    ------------------------------
    Scott Johnston
    Sr Architect &n Developer
    Sonna Solutions
    Dover DE US
    ------------------------------


  • 2.  RE: Having Windows Application automatically open a file when uploaded from UV to end-user PC.

    Posted 02-19-2024 15:41

    You don't mention your environment ... which makes a big difference.

    If you are using AccuTerm, then it is simple to generate an AccuTerm script in UV. AccuTerm will run the script on the client to open the file. See program 'AT.OPEN.DOCUMENT' in the SAMPLES folder (in the ACCUTERM account).

    I believe Wintegrate also has similar functionality.

    If you don't use AccuTerm (or similar), then you need some functionality to communicate with a remote system. If your UV server is Windows, then you could use the functionality outlined here: https://superuser.com/questions/734642/how-to-run-a-program-on-a-remote-pc-via-command-line

    If your UV server is Linux, then there may be a way, but I don't know what it is.

    Cheers,

    Brian



    ------------------------------
    Brian Speirs
    Senior Analyst - Information Systems
    Rush Flat Ltd
    Wellington NZ
    ------------------------------



  • 3.  RE: Having Windows Application automatically open a file when uploaded from UV to end-user PC.

    Posted 02-20-2024 08:42

    OKAY, the details RHEL 8.X, Win11 for the users. Old fashioned legacy program called "E-term".  Nothing really high tech or unique.  The emulator, E-term, captures about 1500 or so line of text and can dump them to a text file and open that file to Notepad,  It doesn't seem like a big deal.  I was hoping to just tap into that functionality, but that went nowhere.  

    The search continues....



    ------------------------------
    Scott Johnston
    Sr Architect &n Developer
    Sonna Solutions
    Dover DE US
    ------------------------------



  • 4.  RE: Having Windows Application automatically open a file when uploaded from UV to end-user PC.

    Posted 02-20-2024 11:53

    Opening the file means basically "Launching" the file at the Windows main processor.

    Accuterm can do this, and you can use that funtionality to open any file, in its native application (Excel, web browser, notepad, anything at all) provided you have associated that file TYPE to that application.  So if you create a file with a name ending in .html and you have associated that to some specific web browser, then merely launching it (which can be done by an accuterm command embedded in your universe BASIC program) will open it in Windows, in that web browser.

    Or excel, or turbo tax or whatever app is associated with whatever file TYPE and your file ends in that type specification



    ------------------------------
    Will Johnson
    Systems Analyst
    Rocket Forum Shared Account
    ------------------------------



  • 5.  RE: Having Windows Application automatically open a file when uploaded from UV to end-user PC.

    Posted 02-20-2024 12:11

    To expand on this a bit. You just need to send the correct escape sequence.

    This will run the command and return to AccuTerm:

    PRINT CHAR(27):CHAR(2):'<"Z:\My Documents\excelname.xls"':CHAR(13):

    This will run it and wait for it to finish before resuming the terminal functions:

    PRINT CHAR(27):CHAR(2):'>"Z:\My Documents\excelname.xls"':CHAR(13):

    It's in the AccuTerm manual section 3.1 External Program Execution. It shows ESC and STX instead of CHAR(27) and CHAR(2) but the above is what is actually sent.



    ------------------------------
    Joe Goldthwaite
    Consultant
    Phoenix AZ US
    ------------------------------



  • 6.  RE: Having Windows Application automatically open a file when uploaded from UV to end-user PC.

    Posted 02-21-2024 13:30

    Only E-term no choice.



    ------------------------------
    Scott Johnston
    Sr Architect &n Developer
    Sonna Solutions
    Dover DE US
    ------------------------------



  • 7.  RE: Having Windows Application automatically open a file when uploaded from UV to end-user PC.

    Posted 02-21-2024 13:30

    The company only uses E-term. I have no access (or permission) for any other emulator.



    ------------------------------
    Scott Johnston
    Sr Architect &n Developer
    Sonna Solutions
    Dover DE US
    ------------------------------



  • 8.  RE: Having Windows Application automatically open a file when uploaded from UV to end-user PC.

    Posted 02-21-2024 13:44

    Can you send a link to the website for E-term? The only thing I can find with that name is an x-window terminal emulator which would mean you're running it on a Linux machine.



    ------------------------------
    Joe Goldthwaite
    Consultant
    Phoenix AZ US
    ------------------------------



  • 9.  RE: Having Windows Application automatically open a file when uploaded from UV to end-user PC.

    Posted 02-21-2024 15:15

    That's correct. However, we (Epicor) have a customized version.  Self installing with a couple of options not included in the one on SourceFroge. But as I said, I got as far as uploading a file to a C: drive directory. A script that runs and detects the new file creation.  



    ------------------------------
    Scott Johnston
    Sr Architect &n Developer
    Sonna Solutions
    Dover DE US
    ------------------------------



  • 10.  RE: Having Windows Application automatically open a file when uploaded from UV to end-user PC.

    Posted 02-21-2024 15:48

    Oh, okay. The approach you're taking should work. The problem is, if your users are running Linux, which Windows machine do you want to run it on? Does each user have their own machine or are you using virtual machines running on a server that they're connecting to?

    If you have individual users running their own Windows instance, are you planning on having each of them create a shared directory on their machine that the Linux side can write to? Are you going to install your script that monitors the folder for new files are every Windows machine?

    It can get clumsy pretty fast. Have you thought about creating the file and then emailing it to the user? That's a common approach.



    ------------------------------
    Joe Goldthwaite
    Consultant
    Phoenix AZ US
    ------------------------------



  • 11.  RE: Having Windows Application automatically open a file when uploaded from UV to end-user PC.

    Posted 02-26-2024 16:44

    Scott,

    You cou;d create a WIndows Task Scheduler script that scans a target directory at set intervals for files appearing. As and when a file appears you can do with it whatv you will.,

    JJ

    Regards



    ------------------------------
    John Jenkins
    Thame, Oxfordshire
    ------------------------------