Hi,
I am try send a file to Alfresco.. My site web is Wordpress and i use a plugin Gravity Flow. I am creating a snippe pero this code is not work for me. This is me code
public function process(){
// Do something here.
$entry = $this->get_entry();
$file = file_get_contents($entry['1']);
$url = 'http://127.0.0.1:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-shared-/children?alf_ticket=TICKET_1a3f7c17063af5f65b0b128f2f2ddeb2021d2258';
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_POST, 1 );
curl_setopt( $ch, CURLOPT_POSTFIELDS, $file );
curl_setopt( $ch, CURLOPT_HTTPHEADER, [
'Content-Disposition: form-data; filedata="Bilgais1.docx"',
] );
$result = curl_exec( $ch );
curl_close( $ch );
print_r( json_decode( $result ) );
return true;
}
I have this error
{"error":{"errorKey":"Could not read content from HTTP request body: Unexpected character ('P' (code 80)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: java.io.BufferedReader@48162477; line: 1, column: 2]","statusCode":400,"briefSummary":"03020018 Could not read content from HTTP request body: Unexpected character ('P' (code 80)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: java.io.BufferedReader@48162477; line: 1, column: 2]","stackTrace":"Por motivos de seguridad, ya no se muestra el seguimiento de la pila, pero se guarda la propiedad para versiones anteriores.","descriptionURL":"https://api-explorer.alfresco.com"}}
I hope someone can help me. Thank you