I need help with upload files trough the Dspace Cris 7 API.
I need the bundle uuid for this? or the item uuid. i receive 400
and the endpoits i use now: /server/api/core/bundles/$bundleUuid/bitstreams
                $data = [
                    'file' => new \CURLFile(trim($ruta), 'application/pdf', 
basename($ruta)),
                    'properties' => json_encode([
                        'name' => basename($ruta),
                        'description' => 'Documento cargado a DSpace',
                        'mimeType' => 'application/pdf'
                    ])
                ];
                $ch = curl_init($bitstreamUrl);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                curl_setopt($ch, CURLOPT_HTTPHEADER, [
                    "Authorization: Bearer $token",
                    "Accept: application/json",
                    "Content-Type: multipart/form-data"
                ]);
                curl_setopt($ch, CURLOPT_POST, true);
                curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
                $response = curl_exec($ch);
                $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
                curl_close($ch); 

-- 
All messages to this mailing list should adhere to the Code of Conduct: 
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/dspace-tech/8a3534ea-390e-45ec-b755-74061a6e6a74n%40googlegroups.com.

Reply via email to