Jump to content

php call servlet


dimis283

Recommended Posts

I have done a php backup application .

So there is a  form that user pick some files to zip and download.

Because of a problem with greek characters I make a servet (java) to create the zip.

But I want to keep all validations that php make, so how can php send to servlet the post data after the validation?

I tried curl but with that nothing is dowloading.

 

...
//form has send files, use of yiiframework
if ($download->validate()) {
Yii::app()->myutilitie->afterAuth(Yii::app()->user
->name,'Front-end download files '.Yii::app()->user->name);
$ch = curl_init(self::JAVA_URL);
curl_setopt($ch, CURLOPT_POST      ,1);
curl_setopt($ch, CURLOPT_POSTFIELDS    ,$dfiles);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION  ,1);
// curl_setopt($ch, CURLOPT_HEADER      ,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER  ,1);  
$Rec_Data = curl_exec($ch);
...

 

Link to comment
https://forums.phpfreaks.com/topic/180954-php-call-servlet/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.