File extension missing in received file From Insert from URL container

Hi,

I’m trying to upload a file with Insert from URL to a REST Service. But the service receives the file, without the extension in the filename

I used the following syntax for my curl options

"-X " &$method & " -H "Authorization: Bearer "&$token& “” -F “file=@$container” -F “content-type=image”

Where $container is a variable containing the container field

The file is correctly uploaded but without the filename

Did anybody encountered this issue ?

Thanks for your help

P.S : Obvioulsy the file in the container has an extension, ever the GetContainerAttribute(f;“filename”) returns the correct filename with its extension

Ok, found-out the issue thanks to FileMaker 16: cURL and Container Fields Demo | Soliant Consulting demo file

Filemaker send the variable name as the file name ! So you have to name your variable (here “container”), to the actual filename of the file. How convenient…

The curl documentation specifies the option --F supporting a value ‘filename’.

curl -F “file=@localfile;filename=nameinpost” example.com