Results 1 to 3 of 3
  1. #1
    shawngoldw is offline Member
    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0

    Default Accessing the Value of a Form File Input

    Hello everyone,

    I'm currently writing a web application, which involves an html form that includes the upload of very large files (>1 GB). I'm trying to write a java applet that will handle the file upload part of the form, using FTP protocol for the upload.

    I want to select the file to upload through a traditional html form file input element, after which, javascript will call a function in the applet and trigger the FTP upload. I have this solution working, except for 1 issue that I haven't been able to sort out.

    In javascript, the 'value' field of the file input element only returns the name of the file, and not the file path. I need the file path in order to be able to access the file in Java and upload it to the server.

    Does anyone know any way to access the file path of the selected file through Java? Or some other way?

    Thanks,
    Shawn

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,298
    Rep Power
    20

    Default Re: Accessing the Value of a Form File Input

    Quote Originally Posted by shawngoldw View Post
    I want to select the file to upload through a traditional html form file input element
    What's wrong with using a FileDialog or a JFileChooser?

    I suppose you already know that your Applet jar will need to be signed with a trusted certificate for it to be able to access the local filesystem.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    shawngoldw is offline Member
    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0

    Default Re: Accessing the Value of a Form File Input

    Quote Originally Posted by DarrylBurke View Post
    What's wrong with using a FileDialog or a JFileChooser?

    I suppose you already know that your Applet jar will need to be signed with a trusted certificate for it to be able to access the local filesystem.

    db
    Using the html form input is just cleaner and simpler for me to implement for this application, along with the consistency with the rest of the site that it would provide. When it comes down to it though, I will need to do whatever it takes to make the application function and am not opposed to using a FileDialog or JFileChooser if I need to. I would like to exhaust the possibility of doing it the way I would like first, though.

    I've self signed the jar and am able to access the local file system fine.

    Shawn

Similar Threads

  1. Replies: 3
    Last Post: 03-17-2012, 03:49 AM
  2. Replies: 2
    Last Post: 01-25-2012, 11:41 AM
  3. how to retrieve data when i select the input from the form
    By sharanya in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 03-08-2011, 10:39 AM
  4. Create a form, input some data and save to file
    By cselic in forum AWT / Swing
    Replies: 5
    Last Post: 05-07-2010, 12:28 PM
  5. designing form to input into database
    By javahsm in forum New To Java
    Replies: 2
    Last Post: 11-29-2008, 10:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •