in reply to Re: Need to use data passed from FORM from HTML page to CGI upload script.
in thread Need to use data passed from FORM from HTML page to CGI upload script.

Thanks for the comment. What you suggested is absolutely correct but not as per the requirement. I need to provide another button "Download" on the HTML page wherein if user click this button , Circle_Techno.csv should get download(Basically I am calling another download cgi script here for its execution). My bad .. I forgot to write about it in the original post.
  • Comment on Re^2: Need to use data passed from FORM from HTML page to CGI upload script.

Replies are listed 'Best First'.
Re^3: Need to use data passed from FORM from HTML page to CGI upload script.
by poj (Abbot) on Jul 26, 2019 at 13:33 UTC

    You can combine upload and download into one script by using an action parameter on the buttons. For example

    <!DOCTYPE html> <html> <head> <title>MAINTENANCE PAGE</title> </head> <body> <form action="Maintenance_Framework.cgi" method = "post" enctype="mult +ipart/form-data"> <h3>MAINTENANCE PAGE</h3> <p> Circle: <select name="Circle" > <option value="Gabon">Gabon</option> <option value="Tanzania">Tanzania</option> </select> Technology : <select name="Techno" > <option value="Core">Core</option> <option value="RAN">RAN</option> </select> <input type="submit" name="action" value="Download"/></p> File to Upload: <input type="file" name="filecsv"/> <input type="submit" name="action" value="Upload"/> </form> </body> </html>

    Add security features as appropriate to your use case.

    poj

      Thanks for the suggestion. I tried to execute your code but somehow when i am trying to upload file,it is giving error that File not Found. HTML Location -- > /opt/IBM/JazzSM/profile/installedApps/JazzSMNode01Cell/isc.ear/OMNIbusWebGUI.war/custom CGI Location --> /opt/IBM/netcool/gui/omnibus_webgui/etc/cgi-bin Modified HTML code

      <!DOCTYPE html> <html> <head> <title>MAINTENANCE PAGE</title> </head> <body> <form action="https://10.XXX.XXX.X:16311/ibm/console/webtop/cgi-bin/Ma +intenance_Framework.cgi" method = "post" enctype="multipart/form-data +"> <h3>MAINTENANCE PAGE</h3> <p> Circle: <select name="Circle" > <option value="Gabon">Gabon</option> <option value="Tanzania">Tanzania</option> </select> Technology : <select name="Techno" > <option value="Core">Core</option> <option value="RAN">RAN</option> </select> <input type="submit" name="action" value="Download"/></p> File to Upload: <input type="file" name="filecsv"/> <input type="submit" name="action" value="Upload"/> </form> </body> </html>

      I tried to use the same example which you listed but somehow when I am clicking the upload button,it is stating that Maintenance_Framework.cgi is not found. HTML page location - > /opt/IBM/JazzSM/profile/installedApps/JazzSMNode01Cell/isc.ear/OMNIbusWebGUI.war/custom CGI location - > /opt/IBM/netcool/gui/omnibus_webgui/etc/cgi-bin HTML Code for your reference which I modified in your base code

      <!DOCTYPE html> <html> <head> <title>MAINTENANCE PAGE</title> </head> <body> <form action="https://10.XXX.XXX.X:16311/ibm/console/webtop/cgi-bin/Ma +intenance_Framework.cgi" method = "post" enctype="multipart/form-data +"> <h3>MAINTENANCE PAGE</h3> <p> Circle: <select name="Circle" > <option value="Gabon">Gabon</option> <option value="Tanzania">Tanzania</option> </select> Technology : <select name="Techno" > <option value="Core">Core</option> <option value="RAN">RAN</option> </select> <input type="submit" name="action" value="Download"/></p> File to Upload: <input type="file" name="filecsv"/> <input type="submit" name="action" value="Upload"/> </form> </body> </html>

        Is

        https://10.XXX.XXX.X:16311/ibm/console/webtop/cgi-bin/Maintenance_Framework.cgi
        a valid URL if you enter it directly in the browser ?

        poj