migrating to AIR when using url "POST" request

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

migrating to AIR when using url "POST" request

Paul Stearns
In many places in our applications we use the navigateToURL method to load another browser window with Excel Spreadsheets and other items we generate from code on our website. We invariably use "POST" instead of "GET" for various reasons, some of which cannot be converted to "GET."

Where can I find information on how to convert;

var u:URLRequest = new URLRequest(_RootDomain + urlExcelExport);
u.data = variables;
u.method = "POST";

navigateToURL(u, "_blank");

to something which will work from AIR? Perhaps URLloader?

Paul R. Stearns
Advanced Consulting Enterprises, Inc.

15280 NW 79th Ct.
Suite 250
Miami Lakes, Fl 33016

Voice: (305)623-0360 x107
Fax: (305)623-4588


Reply | Threaded
Open this post in threaded view
|

Re: migrating to AIR when using url "POST" request

Alex Harui-2
At a higher-level, what is the user goal?  Can you open Excel itself or does it have to be a browser window?

-Alex

On 6/17/20, 10:53 AM, "Paul Stearns" <[hidden email]> wrote:

    In many places in our applications we use the navigateToURL method to load another browser window with Excel Spreadsheets and other items we generate from code on our website. We invariably use "POST" instead of "GET" for various reasons, some of which cannot be converted to "GET."
   
    Where can I find information on how to convert;
   
    var u:URLRequest = new URLRequest(_RootDomain + urlExcelExport);
    u.data = variables;
    u.method = "POST";
   
    navigateToURL(u, "_blank");
   
    to something which will work from AIR? Perhaps URLloader?
   
    Paul R. Stearns
    Advanced Consulting Enterprises, Inc.
   
    15280 NW 79th Ct.
    Suite 250
    Miami Lakes, Fl 33016
   
    Voice: (305)623-0360 x107
    Fax: (305)623-4588
   
   
   

Reply | Threaded
Open this post in threaded view
|

Re: migrating to AIR when using url "POST" request

Paul Stearns
Alex:

My goal is to receive the file on the client and open Excel.

For the moment i did;

//            navigateToURL(u, "_blank");
           var objDownloadFile:FileReference = new FileReference;
           objDownloadFile.download(u,strFileName + ".xlsx");

which will allow the user to download the file. It would be nice to give them the option to open it from the application.

Paul R. Stearns
Advanced Consulting Enterprises, Inc.

15280 NW 79th Ct.
Suite 250
Miami Lakes, Fl 33016

Voice: (305)623-0360 x107
Fax: (305)623-4588

----------------------------------------
From: Alex Harui <[hidden email]>
Sent: 6/18/20 12:04 AM
To: "[hidden email]" <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: migrating to AIR when using url "POST" request
At a higher-level, what is the user goal? Can you open Excel itself or does it have to be a browser window?

-Alex

On 6/17/20, 10:53 AM, "Paul Stearns" <[hidden email]> wrote:

In many places in our applications we use the navigateToURL method to load another browser window with Excel Spreadsheets and other items we generate from code on our website. We invariably use "POST" instead of "GET" for various reasons, some of which cannot be converted to "GET."

Where can I find information on how to convert;

var u:URLRequest = new URLRequest(_RootDomain + urlExcelExport);
u.data = variables;
u.method = "POST";

navigateToURL(u, "_blank");

to something which will work from AIR? Perhaps URLloader?

Paul R. Stearns
Advanced Consulting Enterprises, Inc.

15280 NW 79th Ct.
Suite 250
Miami Lakes, Fl 33016

Voice: (305)623-0360 x107
Fax: (305)623-4588


Reply | Threaded
Open this post in threaded view
|

Re: migrating to AIR when using url "POST" request

Alex Harui-2
Paul,

NativeProcess should let you launch the actual application if you know the path to the application.

Would that work for you?
-Alex

On 6/18/20, 5:40 AM, "Paul Stearns" <[hidden email]> wrote:

    Alex:
   
    My goal is to receive the file on the client and open Excel.
   
    For the moment i did;
   
    //            navigateToURL(u, "_blank");
               var objDownloadFile:FileReference = new FileReference;
               objDownloadFile.download(u,strFileName + ".xlsx");
   
    which will allow the user to download the file. It would be nice to give them the option to open it from the application.
   
    Paul R. Stearns
    Advanced Consulting Enterprises, Inc.
   
    15280 NW 79th Ct.
    Suite 250
    Miami Lakes, Fl 33016
   
    Voice: (305)623-0360 x107
    Fax: (305)623-4588
   
    ----------------------------------------
    From: Alex Harui <[hidden email]>
    Sent: 6/18/20 12:04 AM
    To: "[hidden email]" <[hidden email]>, "[hidden email]" <[hidden email]>
    Subject: Re: migrating to AIR when using url "POST" request
    At a higher-level, what is the user goal? Can you open Excel itself or does it have to be a browser window?
   
    -Alex
   
    On 6/17/20, 10:53 AM, "Paul Stearns" <[hidden email]> wrote:
   
    In many places in our applications we use the navigateToURL method to load another browser window with Excel Spreadsheets and other items we generate from code on our website. We invariably use "POST" instead of "GET" for various reasons, some of which cannot be converted to "GET."
   
    Where can I find information on how to convert;
   
    var u:URLRequest = new URLRequest(_RootDomain + urlExcelExport);
    u.data = variables;
    u.method = "POST";
   
    navigateToURL(u, "_blank");
   
    to something which will work from AIR? Perhaps URLloader?
   
    Paul R. Stearns
    Advanced Consulting Enterprises, Inc.
   
    15280 NW 79th Ct.
    Suite 250
    Miami Lakes, Fl 33016
   
    Voice: (305)623-0360 x107
    Fax: (305)623-4588
   
   
   

Reply | Threaded
Open this post in threaded view
|

Re: migrating to AIR when using url "POST" request

Paul Stearns
Alex:

Not really. I do not control the computers the app is installed on. If I could run an associated application that would work. In other words the equivalent of double clicking the file at the OS level.

Paul R. Stearns
Advanced Consulting Enterprises, Inc.

15280 NW 79th Ct.
Suite 250
Miami Lakes, Fl 33016

Voice: (305)623-0360 x107
Fax: (305)623-4588

----------------------------------------
From: Alex Harui <[hidden email]>
Sent: 6/19/20 12:57 AM
To: "[hidden email]" <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: migrating to AIR when using url "POST" request
Paul,

NativeProcess should let you launch the actual application if you know the path to the application.

Would that work for you?
-Alex

On 6/18/20, 5:40 AM, "Paul Stearns" <[hidden email]> wrote:

Alex:

My goal is to receive the file on the client and open Excel.

For the moment i did;

// navigateToURL(u, "_blank");
var objDownloadFile:FileReference = new FileReference;
objDownloadFile.download(u,strFileName + ".xlsx");

which will allow the user to download the file. It would be nice to give them the option to open it from the application.

Paul R. Stearns
Advanced Consulting Enterprises, Inc.

15280 NW 79th Ct.
Suite 250
Miami Lakes, Fl 33016

Voice: (305)623-0360 x107
Fax: (305)623-4588

----------------------------------------
From: Alex Harui <[hidden email]>
Sent: 6/18/20 12:04 AM
To: "[hidden email]" <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: migrating to AIR when using url "POST" request
At a higher-level, what is the user goal? Can you open Excel itself or does it have to be a browser window?

-Alex

On 6/17/20, 10:53 AM, "Paul Stearns" <[hidden email]> wrote:

In many places in our applications we use the navigateToURL method to load another browser window with Excel Spreadsheets and other items we generate from code on our website. We invariably use "POST" instead of "GET" for various reasons, some of which cannot be converted to "GET."

Where can I find information on how to convert;

var u:URLRequest = new URLRequest(_RootDomain + urlExcelExport);
u.data = variables;
u.method = "POST";

navigateToURL(u, "_blank");

to something which will work from AIR? Perhaps URLloader?

Paul R. Stearns
Advanced Consulting Enterprises, Inc.

15280 NW 79th Ct.
Suite 250
Miami Lakes, Fl 33016

Voice: (305)623-0360 x107
Fax: (305)623-4588


Reply | Threaded
Open this post in threaded view
|

Re: migrating to AIR when using url "POST" request

Alex Harui-2
This article implies that you can use “start” on windows.  https://stackoverflow.com/questions/3729187/how-to-open-file-with-default-application-in-cmd.  I think you can use “open” in OSX.  There might be some simpler way that I don’t know.

-Alex

From: Paul Stearns <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Friday, June 19, 2020 at 5:35 AM
To: Alex Harui <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: migrating to AIR when using url "POST" request

Alex:

Not really. I do not control the computers the app is installed on. If I could run an associated application that would work. In other words the equivalent of double clicking the file at the OS level.


Paul R. Stearns
Advanced Consulting Enterprises, Inc.

15280 NW 79th Ct.
Suite 250
Miami Lakes, Fl 33016

Voice: (305)623-0360 x107
Fax: (305)623-4588

________________________________
From: Alex Harui <[hidden email]>
Sent: 6/19/20 12:57 AM
To: "[hidden email]" <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: migrating to AIR when using url "POST" request
Paul,

NativeProcess should let you launch the actual application if you know the path to the application.

Would that work for you?
-Alex

On 6/18/20, 5:40 AM, "Paul Stearns" <[hidden email]> wrote:

Alex:

My goal is to receive the file on the client and open Excel.

For the moment i did;

// navigateToURL(u, "_blank");
var objDownloadFile:FileReference = new FileReference;
objDownloadFile.download(u,strFileName + ".xlsx");

which will allow the user to download the file. It would be nice to give them the option to open it from the application.

Paul R. Stearns
Advanced Consulting Enterprises, Inc.

15280 NW 79th Ct.
Suite 250
Miami Lakes, Fl 33016

Voice: (305)623-0360 x107
Fax: (305)623-4588

----------------------------------------
From: Alex Harui <[hidden email]>
Sent: 6/18/20 12:04 AM
To: "[hidden email]" <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: migrating to AIR when using url "POST" request
At a higher-level, what is the user goal? Can you open Excel itself or does it have to be a browser window?

-Alex

On 6/17/20, 10:53 AM, "Paul Stearns" <[hidden email]> wrote:

In many places in our applications we use the navigateToURL method to load another browser window with Excel Spreadsheets and other items we generate from code on our website. We invariably use "POST" instead of "GET" for various reasons, some of which cannot be converted to "GET."

Where can I find information on how to convert;

var u:URLRequest = new URLRequest(_RootDomain + urlExcelExport);
u.data = variables;
u.method = "POST";

navigateToURL(u, "_blank");

to something which will work from AIR? Perhaps URLloader?

Paul R. Stearns
Advanced Consulting Enterprises, Inc.

15280 NW 79th Ct.
Suite 250
Miami Lakes, Fl 33016

Voice: (305)623-0360 x107
Fax: (305)623-4588




Reply | Threaded
Open this post in threaded view
|

Re: migrating to AIR when using url "POST" request

Paul Stearns
Alex:

The answer was actually much simpler than I was trying to make it. Here is a code snippet which will run the default application for a particular file;

            var strFilePath:String = _objDownloadFile.nativePath;
            var file:File = File.applicationDirectory.resolvePath(strFilePath);
            file.openWithDefaultApplication()

Paul R. Stearns
Advanced Consulting Enterprises, Inc.

15280 NW 79th Ct.
Suite 250
Miami Lakes, Fl 33016

Voice: (305)623-0360 x107
Fax: (305)623-4588

----------------------------------------
From: Alex Harui <[hidden email]>
Sent: 6/20/20 2:53 AM
To: "[hidden email]" <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: migrating to AIR when using url "POST" request
This article implies that you can use “start” on windows. https://stackoverflow.com/questions/3729187/how-to-open-file-with-default-application-in-cmd. I think you can use “open” in OSX. There might be some simpler way that I don’t know.

-Alex

From: Paul Stearns <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Friday, June 19, 2020 at 5:35 AM
To: Alex Harui <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: migrating to AIR when using url "POST" request

Alex:

Not really. I do not control the computers the app is installed on. If I could run an associated application that would work. In other words the equivalent of double clicking the file at the OS level.

Paul R. Stearns
Advanced Consulting Enterprises, Inc.

15280 NW 79th Ct.
Suite 250
Miami Lakes, Fl 33016

Voice: (305)623-0360 x107
Fax: (305)623-4588

________________________________
From: Alex Harui <[hidden email]>
Sent: 6/19/20 12:57 AM
To: "[hidden email]" <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: migrating to AIR when using url "POST" request
Paul,

NativeProcess should let you launch the actual application if you know the path to the application.

Would that work for you?
-Alex

On 6/18/20, 5:40 AM, "Paul Stearns" <[hidden email]> wrote:

Alex:

My goal is to receive the file on the client and open Excel.

For the moment i did;

// navigateToURL(u, "_blank");
var objDownloadFile:FileReference = new FileReference;
objDownloadFile.download(u,strFileName + ".xlsx");

which will allow the user to download the file. It would be nice to give them the option to open it from the application.

Paul R. Stearns
Advanced Consulting Enterprises, Inc.

15280 NW 79th Ct.
Suite 250
Miami Lakes, Fl 33016

Voice: (305)623-0360 x107
Fax: (305)623-4588

----------------------------------------
From: Alex Harui <[hidden email]>
Sent: 6/18/20 12:04 AM
To: "[hidden email]" <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: migrating to AIR when using url "POST" request
At a higher-level, what is the user goal? Can you open Excel itself or does it have to be a browser window?

-Alex

On 6/17/20, 10:53 AM, "Paul Stearns" <[hidden email]> wrote:

In many places in our applications we use the navigateToURL method to load another browser window with Excel Spreadsheets and other items we generate from code on our website. We invariably use "POST" instead of "GET" for various reasons, some of which cannot be converted to "GET."

Where can I find information on how to convert;

var u:URLRequest = new URLRequest(_RootDomain + urlExcelExport);
u.data = variables;
u.method = "POST";

navigateToURL(u, "_blank");

to something which will work from AIR? Perhaps URLloader?

Paul R. Stearns
Advanced Consulting Enterprises, Inc.

15280 NW 79th Ct.
Suite 250
Miami Lakes, Fl 33016

Voice: (305)623-0360 x107
Fax: (305)623-4588