Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > query about file upload using struts

Reply
Thread Tools

query about file upload using struts

 
 
Sudsy
Guest
Posts: n/a
 
      06-07-2004
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?

 
Reply With Quote
 
 
 
 
Peter Kirk
Guest
Posts: n/a
 
      06-07-2004

"Elspeth Thorne" <(E-Mail Removed)> skrev i en meddelelse
news:ca0u4h$2co$(E-Mail Removed)...
> 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/...rtRequest.html

Peter

 
Reply With Quote
 
 
 
 
Elspeth Thorne
Guest
Posts: n/a
 
      06-07-2004
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.
 
Reply With Quote
 
Sudsy
Guest
Posts: n/a
 
      06-07-2004
Peter Kirk wrote:
> "Elspeth Thorne" <(E-Mail Removed)> 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/...rtRequest.html


Peter,
Struts has org.apache.struts.upload.FormFile. Handling uploads is a
no-brainer. Thanks for contributing additional information.

 
Reply With Quote
 
Elspeth Thorne
Guest
Posts: n/a
 
      06-07-2004
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding action mapping to struts-config file in struts ros Java 0 05-15-2007 10:51 AM
Upload a file without file Upload control - ASP.Net =?Utf-8?B?U2FyYXY=?= ASP .Net 3 08-03-2005 01:09 AM
File Upload (struts) IllegalArgumentException lb Java 1 04-15-2004 01:31 PM
file upload with Struts or JSF orientphoebus Java 2 12-19-2003 02:21 PM
Upload Excel with Macros using HTML File Upload Prakash ASP General 3 11-12-2003 04:26 AM



Advertisments