Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#827305
I want to send uploaded file to another portal using another portals API.
so, i am trying to send file using curl command. when i create object of curlfile i got exception "Unserialization of curl file is not allowed".

my trigger is as follow



//===================================File Upload to a Batch==========================

//$data= new CURLFile($filePath,$APP_DOC_FILENAME);

$postfields = array('filedata' =>curl_file_create($filePath, 'multipart/formdata',$APP_DOC_FILENAME));



@@payload=$postFields;

$batchUpload='http://192.168.11.45:8180/nuxeo/api/v1/upload/'.$json['batchId'].'/0';
@@batchUploadURL=$batchUpload;

$ch1 = curl_init($batchUpload);

curl_setopt($ch1, CURLOPT_USERPWD, 'Administrator:Administrator');
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch1, CURLOPT_POST, true);


// Set HTTP Header for POST request
curl_setopt($ch1, CURLOPT_HTTPHEADER, array('Content-type:multipart/form-data'));
curl_setopt($ch1, CURLOPT_POSTFIELDS, $postFields);


$result = curl_exec($ch1);

@@batchUploadResponse=$result;


// Close cURL session handle
curl_close($ch1);
#827312
Hi,
Without writing code in this server you can write code in another server like this, Because it's easier:
Code: Select all
//your processmaker uploaded file link
$remote_file_url = 'http://YOUR_PROCESSMAKER_SERVER_IP/sysworkflow/en/neoclassic/cases/cases_ShowDocument?a=YOUR_APP_DOC_UID';

//local path in portal server
$local_file = 'YOUR_LOCAL_PATH_IN_NEW_SERVER/YOUR_APP_DOC_FILENAME';

copy( $remote_file_url, $local_file );
https://pmlearning.info
Thanks
Last edited by programerboy on Wed Apr 07, 2021 1:09 am, edited 1 time in total.

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]