Hello, I did a quick test but can’t reproduce your problem. testing the curl command on a RHEL box:
curl -ku User:password --form upload=@/etc/“sudoers” https://nc147440:52311/api/upload
The server is a windows machine, the file is correctly uploaded into the upload dir at:
C:\Program Files (x86)\BigFix Enterprise\BES Server\wwwrootbes\Uploads\7f8136e115bc8877afdda1cb9c357da7ecdbb8d2\sudoers
The last line of the file contains the HEX OA which is also in the original file on my RHEL machine, the “hexdump -C ./sudoers” command shows it:
Yes that behavior looks like the file was edited on a Windows machine…Windows uses the CR/LF combination for an end-of-line ( %0d%0a ) where UNIX uses a single linefeed character ( %0a ).
If a DOS text file with cr/LF is opened on some UNIX editors like vi, the CR/LF combination is displayed as ^M
It’s likely your file was modified somewhere before you uploaded it. I haven’t seen curl do that, but perhaps someone opened in Notepad and saved it?
I tar’d the file and uploaded to rest api to avoid this CTRL-M issue. I think some where in the root rest api is adding the additional carriage return. I have pushed the same sudoers via curl to linux hosts it works fine.