1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Internal server error!

Discussion in 'SQL PL/SQL' started by Jesthr, Oct 26, 2017.

  1. Jesthr

    Jesthr Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    Dear!

    I would like to load the image from the web browser and save the image on Oracle table!
    I have Oracle XE database on Linux server

    <html>
    <head>
    <title>test upload</title>
    </head>
    <body>
    <FORM enctype="multipart/form-data"
    action="pls/mydad/write_info"
    method="POST">
    <p>Author's Name:<INPUT type="text" name="who">
    <p>Description:<INPUT type="text" name="description"><br>
    <p>File to upload:<INPUT type="file" name="filename"><br>
    <p><INPUT type="submit">
    </FORM>
    </body>
    </html>

    procedure write_info (
    who in varchar2,
    description in varchar2,
    filename in varchar2) as
    begin
    insert into myTable values (who, description, filename);
    htp.htmlopen;
    htp.headopen;
    htp.title('Filename Uploaded');
    htp.headclose;
    htp.bodyopen;
    htp.header(1, 'Upload Status');
    htp.print('Uploaded ' || filename || ' successfully');
    htp.bodyclose;
    htp.htmlclose;
    end;

    When I run this script, I received an error: Internal Server Error!

    I can not find what's wrong!

    The scrept run o.k. if I use only <FORM> class!!!
    With enctype="multipart/form-data the error is Internal Server Error!

    Regrads!

    Hine
     
  2. krasnoslobodtsev_si

    krasnoslobodtsev_si Forum Genius

    Messages:
    733
    Likes Received:
    143
    Trophy Points:
    830
    Location:
    Russian Federation
    What is your Oracle version?

    For example:
    Code (Text):

    DECLARE
     v_html VARCHAR2(4000):= q'{
    <html>
    <head>
    <title>test upload</title>
    </head>
    <body>
    <FORM enctype="multipart/form-data"
    action="pls/mydad/write_info"
    method="POST">
    <p>Author's Name:<INPUT type="text" name="who">
    <p>Description:<INPUT type="text" name="description"><br>
    <p>File to upload:<INPUT type="file" name="filename"><br>
    <p><INPUT type="submit">
    </FORM>
    </body>
    </html>
    }';

    begin
    --insert into myTable values (who, description, filename);
    htp.htmlopen;
    htp.headopen;
    htp.title('Filename Uploaded');
    htp.headclose;
    htp.bodyopen;
    htp.header(1, 'Upload Status');
    htp.print('Uploaded'||  v_html ||'successfully');
    htp.bodyclose;
    htp.htmlclose;
    end;
    /
     
     
    Last edited: Oct 26, 2017
  3. Jesthr

    Jesthr Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55

    PLSQL_GATEWAY = WebDb
    GATEWAY_IVERSION = 2
    SERVER_SOFTWARE = Oracle Embedded PL/SQL Gateway/11.2.0.4.0
    GATEWAY_INTERFACE = CGI/1.1
    SERVER_PORT = 8088
    SERVER_NAME = XDB HTTP Server
    REQUEST_METHOD = GET
    PATH_INFO = /CGIenv
    SCRIPT_NAME = /mytest
    REMOTE_HOST =
    REMOTE_ADDR = xx.xx.xx.xxx
    SERVER_PROTOCOL = HTTP/1.1
    REQUEST_PROTOCOL = HTTP
    REMOTE_USER = MYTESTS
    ORACLE_SSO_USER =
    HTTP_CONTENT_LENGTH = 0
    HTTP_CONTENT_TYPE =
    HTTP_USER_AGENT = Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; MS-RTC LM 8; .NET4.0E)
    HTTP_HOST = xxxxxx:8088
    HTTP_ACCEPT = application/x-ms-application,image/jpeg,application/xaml+xml,image/gif,image/pjpeg,application/x-ms-xbap,application/vnd.ms-excel,application/vnd.ms-powerpoint,application/msword,*/*
    HTTP_ACCEPT_ENCODING = gzip,deflate
    HTTP_ACCEPT_LANGUAGE = sl-SI
    WEB_AUTHENT_PREFIX =
    DAD_NAME = mytest
    DOC_ACCESS_PATH = docs
    DOCUMENT_TABLE = wpg_document
    PATH_ALIAS =
    REQUEST_CHARSET = AL32UTF8
    REQUEST_IANA_CHARSET = UTF-8
    SCRIPT_PREFIX =