fetch changes from branch export_to_lims

This commit is contained in:
2026-03-09 17:04:03 +03:00
parent 2598a4c91b
commit 93930227a2
3 changed files with 86 additions and 76 deletions
@@ -206,13 +206,12 @@ class VisualLimsApiClient
/**
* POST a file as multipart/form-data (used for photo/attachment uploads).
*
* @param string $endpoint OData endpoint, e.g. "AllegatoCommessaWeb"
* @param string $filePath Absolute path to the file on disk
* @param string $fileName Original file name to send
* @param int $commessaId CommessaWeb ID to link the attachment to
* @return array|null Decoded JSON response
* @param string $endpoint OData endpoint, e.g. "Campione(613388)/UploadCampioneFile"
* @param string $filePath Absolute path to the file on disk
* @param string $fileName Original file name to send
* @return array|null Decoded JSON response
*/
public function postMultipart($endpoint, $filePath, $fileName, $commessaId)
public function postMultipart($endpoint, $filePath, $fileName)
{
$token = $this->getToken();
$url = "{$this->baseUrl}/api/odata/{$endpoint}";
@@ -220,9 +219,7 @@ class VisualLimsApiClient
$cfile = new CURLFile($filePath, mime_content_type($filePath) ?: 'application/octet-stream', $fileName);
$payload = [
'IdCommessa' => $commessaId,
'NomeFile' => $fileName,
'file' => $cfile,
'file' => $cfile,
];
$ch = curl_init($url);