Re: Railo 4 cannot cfhttp post files to php servers (RAILO-2280)

67 views
Skip to first unread message

Jean Moniatte

unread,
May 16, 2013, 5:07:06 PM5/16/13
to Railo Google Group
Hello,

I am experiencing the issue described at https://issues.jboss.org/browse/RAILO-2280 where a php server does not properly receive the request when a file is posted via cfhttp.

The reporter of the issue mentioned a workaround using Java to do the POST. Could anyone share any code or give hints as to where to start? Or ideas for another workaround?

Thanks in advance for any help, I am really stuck on this one for a urgent project.

Jean
--
Jean Moniatte
UGAL



Denny

unread,
May 16, 2013, 9:43:40 PM5/16/13
to ra...@googlegroups.com
On 5/16/13 3:07 PM, Jean Moniatte wrote:
...
> The reporter of the issue mentioned a workaround using Java to do the POST.
> Could anyone share any code or give hints as to where to start? Or ideas
> for another workaround?

If it's the one I'm thinking of, the actual problem is posts which are
redirected, which the newer libraries don't do by default (security).

Can you verify this is the case for you (with curl maybe), or perhaps
provide a php page and a cfml page which can be used for testing?

I might be thinking of something else though. As for the java route, I
think you'd just look up a POST example for apache-commons-httpclient?

:Denny

--
Railo Technologies: getrailo.com Professional Open Source
Skype: valliantster (505)510.1336 de...@getrailo.com
GnuPG-FP: DDEB 16E1 EF43 DCFD 0AEE 5CD0 964B B7B0 1C22 CB62

Jean Moniatte

unread,
May 17, 2013, 2:59:25 AM5/17/13
to Railo Google Group
Hello Denny,

Thanks for the reply.

I guess that you mean 301/302 type redirects? I just checked with a POST from a browser, a 200 status code is returned, no redirect seems to be involved. The cfhttp fails the same way when adding a redirect="yes" attribute.

I don't know much about php, but I will ask a friend if he can host a .php page that dumps the content of whatever request it receives.

Looking at apache-commons-httpclient. Thanks again.

Jean
--
Jean Moniatte
UGAL

--
Did you find this reply useful?  Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki


If you don't have time, add a request to the Railo Server wiki to-do page at https://github.com/getrailo/railo/wiki/Todo
---
You received this message because you are subscribed to the Google Groups "Railo" group.
For more options, visit https://groups.google.com/groups/opt_out.



Igal Sapir

unread,
May 17, 2013, 3:07:35 AM5/17/13
to Railo List

I don't think that you can rely on the browser for that as it might do the redirect behind the scenes without reporting on it.

Use curl as Denny suggested or wfetch if you're on Windows.

--
typos, misspels, and other weird words brought to you courtesy of my mobile device and its auto-(in)correct feature.

Jean Moniatte

unread,
May 17, 2013, 3:18:03 AM5/17/13
to Railo Google Group
I know, I was looking at the response code with Firebug. Will try wfetch to be 200% sure.

Thanks,
Jean
--
Jean Moniatte
UGAL

Jean Moniatte

unread,
May 17, 2013, 3:30:03 AM5/17/13
to Railo Google Group
Hello,

Yop, I confirm the 200 code without redirects:

POST /iaeext/telecharge.php HTTP/1.1\r\n
Accept: */*\r\n
\r\n
RESPONSE: **************\nHTTP/1.1 200 OK\r\n
Date: Fri, 17 May 2013 07:28:48 GMT\r\n
Server: Apache\r\n
Vary: Accept-Encoding,User-Agent\r\n
Content-Length: 86\r\n
Content-Type: text/html; charset=iso-8859-1\r\n
Content-Language: fr\r\n
\r\n
<strong><br><br><br><br><br>Vous n'êtes pas autorisés à afficher cette page !</strong>

Thanks,
Jean
--
Jean Moniatte
UGAL

Jean Moniatte

unread,
May 17, 2013, 7:46:15 AM5/17/13
to Railo Google Group
Hello,

Christian Braun (the poster who mentioned the Java version of the POST in RAILO-2280 and RAILO-2400) was kind enough to email me the code he is using for posting directly with org.apache.commons.httpclient. It works like a charm, we are now able to post files to the php server.

Thanks,
Jean
--
Jean Moniatte
UGAL

Igal Sapir

unread,
May 17, 2013, 10:18:43 AM5/17/13
to Railo List

Can you upload that file as attachment to the JIRA ticket for others (and we'll try to take care of it in Railo as well)?

Thanks,

Igal

--
typos, misspels, and other weird words brought to you courtesy of my mobile device and its auto-(in)correct feature.

Jean Moniatte

unread,
May 17, 2013, 4:33:21 PM5/17/13
to Railo Google Group
Hello,

I have attached a file to the ticket that compares the results of cfhttp vs apache.commons.httpclient posts to a php script. When a file is added to the post, the php script does not see any of the cfhttp post data, whereas the httpclient data is there.

The php script used for the post is hosted by a friend, we can request modifications if needed.


Thanks,
Jean
--
Jean Moniatte
UGAL

Reply all
Reply to author
Forward
0 new messages