Communication between Java applet and javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • david

    #1

    Communication between Java applet and javascript

    Hello all,

    let's me explains my long problem:

    I'm doing an intranet with a media part. So im must be able to upload files on
    a ftp server AND have a record of informations about this file and meta date in
    a MySQL database, shown in a php page.

    So the first thing i was doing was:

    1/ * A HTML Form, with a <input type="file"> which was uploading the file to
    the web server. And then, in the next action-php-page, using ftp functions from
    php to upload to the ftp server. But this make upload the file 2 times, which
    slow, and the user can't do anythig except waiting in front of a blanck loading
    page.

    => no way

    (BTW, the site admin refuse that the ftp server and the web server to be the
    same computer)


    So i tried something else:

    2/ * A HTML form, the user enter meta data about the media, click next, and
    then, a php page which loads a java applet an pass informations to it (by param
    tags).
    The applet have a browse button, and a go button, which start the transfert
    (JDK 1.4.1) trough the URLConnection. The file is uploaded once, and there is a
    progress bar, which is wonderful.

    But now, i need the src_file information wich is the java applet. So i have two
    options:

    A/ I make a post to the webserver from the applet. But i'm using session
    identification (needed for tracing users actions) and i'm gonna use SSL in less
    than one month, so i think it would be complicated.

    B/ I export the information from the java applet to javascript, and then to
    HTML hidden field, so that the user can submit the full-hidden-filled form. But
    i can't make LiveConnect works.

    i'm under Mac OS X 10.2 (jaguar) so i need to make work LiveConnect on both
    Safari 1.0 (v85.6), mozilla 1.5, and Mac OS IE (5.2).

    After few hours on google, searching for informations and already working
    liveconnect example, i'm in big doubt...

    Is there any other way??

    Thx for helping a desesperate developper...

    --
    david

  • Ike

    #2
    Re: Communication between Java applet and javascript

    Real's HowTo : Useful code snippets for Java, JS, PB and more


    "david" <pas.d.email@se rver.com> wrote in message
    news:brul4j$adn $1@news-reader1.wanadoo .fr...[color=blue]
    > Hello all,
    >
    > let's me explains my long problem:
    >
    > I'm doing an intranet with a media part. So im must be able to upload[/color]
    files on[color=blue]
    > a ftp server AND have a record of informations about this file and meta[/color]
    date in[color=blue]
    > a MySQL database, shown in a php page.
    >
    > So the first thing i was doing was:
    >
    > 1/ * A HTML Form, with a <input type="file"> which was uploading the file[/color]
    to[color=blue]
    > the web server. And then, in the next action-php-page, using ftp functions[/color]
    from[color=blue]
    > php to upload to the ftp server. But this make upload the file 2 times,[/color]
    which[color=blue]
    > slow, and the user can't do anythig except waiting in front of a blanck[/color]
    loading[color=blue]
    > page.
    >
    > => no way
    >
    > (BTW, the site admin refuse that the ftp server and the web server to be[/color]
    the[color=blue]
    > same computer)
    >
    >
    > So i tried something else:
    >
    > 2/ * A HTML form, the user enter meta data about the media, click next,[/color]
    and[color=blue]
    > then, a php page which loads a java applet an pass informations to it (by[/color]
    param[color=blue]
    > tags).
    > The applet have a browse button, and a go button, which start the[/color]
    transfert[color=blue]
    > (JDK 1.4.1) trough the URLConnection. The file is uploaded once, and there[/color]
    is a[color=blue]
    > progress bar, which is wonderful.
    >
    > But now, i need the src_file information wich is the java applet. So i[/color]
    have two[color=blue]
    > options:
    >
    > A/ I make a post to the webserver from the applet. But i'm using session
    > identification (needed for tracing users actions) and i'm gonna use SSL in[/color]
    less[color=blue]
    > than one month, so i think it would be complicated.
    >
    > B/ I export the information from the java applet to javascript, and then[/color]
    to[color=blue]
    > HTML hidden field, so that the user can submit the full-hidden-filled[/color]
    form. But[color=blue]
    > i can't make LiveConnect works.
    >
    > i'm under Mac OS X 10.2 (jaguar) so i need to make work LiveConnect on[/color]
    both[color=blue]
    > Safari 1.0 (v85.6), mozilla 1.5, and Mac OS IE (5.2).
    >
    > After few hours on google, searching for informations and already working
    > liveconnect example, i'm in big doubt...
    >
    > Is there any other way??
    >
    > Thx for helping a desesperate developper...
    >
    > --
    > david
    >[/color]


    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: Communication between Java applet and javascript

      Ike wrote:
      [color=blue]
      > http://www.rgagnon.com/howto.html
      >
      > [Top post][/color]




      SCNR

      PointedEars

      Comment

      Working...