query about file upload using struts

Discussion in 'Java' started by Sudsy, Jun 7, 2004.

  1. Sudsy

    Sudsy Guest

    Elspeth Thorne wrote:
    > Hello,
    >
    > I'm trying to code a sever-side application that recieves file uploads
    > from a remote client over http.


    Okay...

    > The recieving environment is using Apache/Tomcat, and I'll be using
    > struts and java servlets to handle incoming requests.


    Easy enough...

    > The remote client is not a web browser, and will probably not be using
    > any sort of web form for the upload.


    I though you said you were working on the server side! Why should you
    concern yourself with how the client is going to behave. It will just
    have to act just like a browser insofar as using HTTP to communicate
    with your server-side application. Probably use a POST equivalent...

    So what's the problem?
     
    Sudsy, Jun 7, 2004
    #1
    1. Advertising

  2. Sudsy

    Peter Kirk Guest

    "Elspeth Thorne" <> skrev i en meddelelse
    news:ca0u4h$2co$...
    > Sudsy wrote:
    > > Elspeth Thorne wrote:
    > >
    > >> Hello,
    > >>
    > >> I'm trying to code a sever-side application that recieves file uploads
    > >> from a remote client over http.

    > >
    > >
    > > Okay...
    > >
    > >> The recieving environment is using Apache/Tomcat, and I'll be using
    > >> struts and java servlets to handle incoming requests.

    > >
    > >
    > > Easy enough...
    > >
    > >> The remote client is not a web browser, and will probably not be using
    > >> any sort of web form for the upload.

    > >
    > >
    > > I though you said you were working on the server side! Why should you
    > > concern yourself with how the client is going to behave. It will just
    > > have to act just like a browser insofar as using HTTP to communicate
    > > with your server-side application. Probably use a POST equivalent...
    > >
    > > So what's the problem?
    > >

    > I don't know what said POST equivalent is.
    >
    > As I said, it's a trivial problem, but I just don't get it today.


    Just as the reply you got said: your server-side application doesn't care
    who sends the request, just as long as the request is the right format. And
    that would most likely be a HTTP POST.

    Your original message said you were using HTTP, and you were using
    Struts/servlets to handle the upload, so a "multipart" POST seems a
    reasonable way to go.

    You just need to code your application as you normally would as if the
    client were a browser with a form. I am not sure if Struts itself offers
    upload handler classes, but if not there are for example:
    jakarta file upload: http://jakarta.apache.org/commons/fileupload/
    jason hunter
    http://www.servlets.com/cos/javadoc/com/oreilly/servlet/MultipartRequest.html

    Peter
     
    Peter Kirk, Jun 7, 2004
    #2
    1. Advertising

  3. Hello,

    I'm trying to code a sever-side application that recieves file uploads from a
    remote client over http.

    The recieving environment is using Apache/Tomcat, and I'll be using struts and
    java servlets to handle incoming requests.

    The remote client is not a web browser, and will probably not be using any sort
    of web form for the upload.

    I realise that this is probably trivial, but I just can't get my head around it
    at the moment.

    Thanks,

    Elspeth.
     
    Elspeth Thorne, Jun 7, 2004
    #3
  4. Sudsy

    Sudsy Guest

    Peter Kirk wrote:
    > "Elspeth Thorne" <> skrev i en meddelelse

    <snip>
    > Your original message said you were using HTTP, and you were using
    > Struts/servlets to handle the upload, so a "multipart" POST seems a
    > reasonable way to go.
    >
    > You just need to code your application as you normally would as if the
    > client were a browser with a form. I am not sure if Struts itself offers
    > upload handler classes, but if not there are for example:
    > jakarta file upload: http://jakarta.apache.org/commons/fileupload/
    > jason hunter
    > http://www.servlets.com/cos/javadoc/com/oreilly/servlet/MultipartRequest.html


    Peter,
    Struts has org.apache.struts.upload.FormFile. Handling uploads is a
    no-brainer. Thanks for contributing additional information.
     
    Sudsy, Jun 7, 2004
    #4
  5. Sudsy wrote:
    > Elspeth Thorne wrote:
    >
    >> Hello,
    >>
    >> I'm trying to code a sever-side application that recieves file uploads
    >> from a remote client over http.

    >
    >
    > Okay...
    >
    >> The recieving environment is using Apache/Tomcat, and I'll be using
    >> struts and java servlets to handle incoming requests.

    >
    >
    > Easy enough...
    >
    >> The remote client is not a web browser, and will probably not be using
    >> any sort of web form for the upload.

    >
    >
    > I though you said you were working on the server side! Why should you
    > concern yourself with how the client is going to behave. It will just
    > have to act just like a browser insofar as using HTTP to communicate
    > with your server-side application. Probably use a POST equivalent...
    >
    > So what's the problem?
    >

    I don't know what said POST equivalent is.

    As I said, it's a trivial problem, but I just don't get it today.


    Elspeth.
     
    Elspeth Thorne, Jun 7, 2004
    #5
    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. =?Utf-8?B?U2FyYXY=?=

    Upload a file without file Upload control - ASP.Net

    =?Utf-8?B?U2FyYXY=?=, Aug 2, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    2,454
    Bruce Barker
    Aug 3, 2005
  2. orientphoebus

    file upload with Struts or JSF

    orientphoebus, Dec 17, 2003, in forum: Java
    Replies:
    2
    Views:
    1,734
    Mladen Adamovic
    Dec 19, 2003
  3. lb
    Replies:
    1
    Views:
    3,326
  4. ros
    Replies:
    0
    Views:
    604
  5. Prakash
    Replies:
    3
    Views:
    464
    Ray at
    Nov 12, 2003
Loading...

Share This Page