File upload servlet using MultipartRequest - file not created on the server

Discussion in 'Java' started by Paul Smith, Nov 14, 2003.

  1. Paul  Smith

    Paul Smith Guest

    Hello All,

    I am playing with Jason Hunter's MultipartRequest servlet to upload a
    file to a server (Tomcat). However, the file is not appearing on the
    server. I have added some println statements to FilePart.writeTo(File
    fileOrDirectory). Everything appears as I would expect - the filename
    and path are correct, and the number of bytes returned by the method
    looks fine. But no file appears on the server. Has anyone else
    experienced this?

    Many thnaks in advance,
    Paul
     
    Paul Smith, Nov 14, 2003
    #1
    1. Advertising

  2. Paul  Smith

    Paul Smith Guest

    Actually the file does make it to the server, it just wasn't in the
    directory I expected, given what parameters I was passing to the
    constructor of MultipartRequest. The file is actually placed in the
    directory from which the Tomcat server was started. As I am starting
    it using the startup script in the bin directory under the server
    root, this is the location that "." results in in the code below.

    // Here we (rudely) write to the server root and impose 5 Meg limit.
    MultipartRequest multi = new MultipartRequest(req, ".", 5 * 1024 *
    1024);

    Paul
     
    Paul Smith, Nov 17, 2003
    #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. Ones Self
    Replies:
    1
    Views:
    834
    Ryan Stewart
    Dec 26, 2004
  2. Replies:
    0
    Views:
    451
  3. John C. Wallace

    C++ MultipartRequest

    John C. Wallace, Sep 29, 2003, in forum: C++
    Replies:
    1
    Views:
    441
    Jonathan Mcdougall
    Sep 29, 2003
  4. John C. Wallace

    C++ MultipartRequest

    John C. Wallace, Sep 29, 2003, in forum: C++
    Replies:
    0
    Views:
    341
    John C. Wallace
    Sep 29, 2003
  5. ragz_82
    Replies:
    0
    Views:
    477
    ragz_82
    Feb 4, 2011
Loading...

Share This Page