Doing a form-based FILE-UPLOAD from inside a servlet

Discussion in 'Java' started by DiscoStu, May 20, 2004.

  1. DiscoStu

    DiscoStu Guest

    Hello Everyone,

    I have two tomcat servers, one running on the client machine and
    one running on the server machine. I needed offline support for my
    application, thats why I need tomcat on the client machine. Well, I
    want to upload my reports to the server and I was thinking the HTML
    form based upload would be nice, but I dont want the user to have to
    select the file thats going to be uploaded. Is there any way to have
    it upload a specific file rather then letting the user select a file?

    Thanks (Maybe this question is better suited to an HTML newsgroup, but
    java makes me happy)
    DiscoStu, May 20, 2004
    #1
    1. Advertising

  2. DiscoStu

    Guest

    Peace be unto you

    Try value

    type=file
    Creates a file select control.
    User agents may use the value of
    the value attribute as the initial file name.

    http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.4


    8. Security Considerations

    It is important that a user agent not send any file that the user has
    not explicitly asked to be sent. Thus, HTML interpreting agents are
    expected to confirm any default file names that might be suggested
    with <INPUT TYPE=file VALUE="yyyy">. Never have any hidden fields be
    able to specify any file.
    http://www.ietf.org/rfc/rfc1867.txt



    Note: Never have any hidden fields be able to specify any file.
    However, I guess user agents might not deter the usage of the javascript submit() function
    or the setting of the css visibility property of the containing element to invisible.


    Have a good day.
    , May 21, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. circuit_breaker
    Replies:
    2
    Views:
    1,989
    Jack Jia
    Apr 4, 2004
  2. Replies:
    3
    Views:
    8,713
    Ross Bamford
    Nov 5, 2005
  3. Replies:
    1
    Views:
    916
    Gabriel Genellina
    Nov 25, 2006
  4. Phil Powell
    Replies:
    0
    Views:
    321
    Phil Powell
    Aug 29, 2007
  5. Leon Mayne
    Replies:
    5
    Views:
    4,744
    Leon Mayne
    May 27, 2008
Loading...

Share This Page