You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Amon, Jennifer" <Je...@moen.com> on 2005/02/28 01:24:56 UTC

RE: [httpClient] CF file upload to Tomcat - sample code?

Yes, well, as I said, I'm a total newbie.

I think now, that this will be totally an httpClient issue for my part
of the puzzle.

There are three pieces to this. First, there is the client browser,
where a user inputs a lot of data and makes some choices. Then he clicks
on a button that causes an XML file to be generated and sent (uploaded)
to a TomCat server. The TomCat server will generate a pdf based on the
uploaded XML file, and that file will be returned to the CF server,
where the end user will see a link in his browser, from which he can
download/save the generated file.

When I first started this, someone told me to look at the httpClient and
fileUpload software. I mistakenly assumed I needed the fileUpload piece,
since I'm trying to upload a file. Actually, I need the httpClient
piece, and the TomCat server will be doing the fileUpload piece, if I
even yet understand it all correctly.

I can't use CF native functionality to do this, because I can't
programmatically set the value of a field of type "file." So, ...

Anyway, I think I have found a hunk of sample code that does what I
need.

Thanks,
   Jennifer

------------------------------------------------------------------
Jennifer R. Amon              Phone: 440-962-2471
Lead Technical Consultant       FAX: 440-962-2663
Moen Incorporated             Email: jamon@moen.com
25300 Al Moen Drive        Personal: jenamon@comcast.net
North Olmsted, OH  44070   Web Site: http://home.comcast.net/~jenamon/
------------------------------------------------------------------
-----Original Message-----
From: Martin Cooper [mailto:mfncooper@gmail.com] 
Sent: Sunday, February 27, 2005 2:23 PM
To: Jakarta Commons Users List
Subject: Re: [fileUpload] [httpClient] CF file upload to Tomcat - sample
code?

On Thu, 24 Feb 2005 08:54:55 -0500, Amon, Jennifer
<Je...@moen.com> wrote:
> Yes, how to post from CF to the Tomcat server is the first issue. I
> think we'll have to use httpClient to post. We can't use a form with a
> file field, because you can't dynamically set the file name.

I'm confused by this. If you use HttpClient, you'd be running on the
(ColdFusion?) server, uploading to another (Tomcat) server. If you use
"a form with a file field", you're talking about something that would
be posted by a browser to a (ColdFusion or Tomcat) server. Which are
you trying to do?

> Then, there will be a return of a file from the server as a result of
> what the server does with the xml file. I don't know how to handle
that,
> either.

Again, I'm confused. If the file is coming back from a Tomcat server
to a ColdFusion server, then isn't this then a ColdFusion question?

You prefixed your subject line with [FileUpload], but none of what
you're asking appears to be related to FileUpload. Sorry if I'm
completely misunderstanding.

--
Martin Cooper


> Thanks,
>   Jennifer
> 
> ------------------------------------------------------------------
> Jennifer R. Amon              Phone: 440-962-2471
> Lead Technical Consultant       FAX: 440-962-2663
> Moen Incorporated             Email: jamon@moen.com
> 25300 Al Moen Drive        Personal: jenamon@comcast.net
> North Olmsted, OH  44070   Web Site: http://home.comcast.net/~jenamon/
> ------------------------------------------------------------------
> -----Original Message-----
> From: Tim Reilly [mailto:timothyreilly@gmail.com]
> Sent: Wednesday, February 23, 2005 11:50 PM
> To: Jakarta Commons Users List
> Subject: Re: [fileUpload] CF file upload to Tomcat - sample code?
> 
> On Wed, 23 Feb 2005 14:13:17 -0500, Amon, Jennifer wrote:
> 
> > We want a button click on a web page (ColdFusion/IIS/Win2K) to cause
> an
> > XML file to be generated and uploaded to a TomCat(unix) server,
which
> > will use the xml to generate a pdf file to be sent back to the
client,
> > where it will be saved in a temporary area on the web sever, and the
> > user will get back a link to the pdf.
> >
> > We can generate the xml, but don't know how to do the next piece.
The
> > backend, on the TomCat server, is being written by a 3rd party, so I
> > don't have to worry about that piece.
> >
> Hi Jennifer,
> I'm not clear on what you mean by "next part" ... do you mean how to
> post the xml from CF to the Tomcat server?
> 
> If so that's probably off-topic for commons-user list (but see cfhttp
> tag
http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-p58.htm)
> 
> Or are you asking about how to recieve the file on the Tomcat server?
> Maybe this helps
> http://jakarta.apache.org/commons/fileupload/using.html or maybe this
> article
>
http://www.theserverside.com/articles/content/HttpClient_FileUpload/arti
> cle.html
> 
> HTH,
> -TR
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> _______________________________________________
> This message was scanned for viruses prior to entering the Moen
network
> 
> 
>
_______________________________________________________________________
> 
> The information transmitted is intended only for the person or entity
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender and delete the
material from any computer.
>
_______________________________________________________________________
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


_______________________________________________
This message was scanned for viruses prior to entering the Moen network


_______________________________________________________________________

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
_______________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org