curl -u "myusername:mypassword" -F 'fileToUpload=@./126438386X.tiff' https://coversadmin-prod.mhedu.com/supload.php
The command should return one line of JSON. An example of a successful transfer:
{"status":"success","status_message":"image file is valid. uploaded successfully. archived successfully. recorded successfully"}
Checking for a status of "success" is the primary method of verifying the upload completed properly.
curl -f -u "myusername:badpassword" -F 'fileToUpload=@./126438386X.tiff' https://coversadmin-prod.mhedu.com/supload.php
Curl's exit code for a failed request is "22" for 400-level errors; see the curl documentation for a complete list of exit codes.
An alternate method of checking the result of the upload is by checking the HTTP status code; curl will provide the HTTP status code for you with the "-w" flag:
curl -w '\n%{http_code}\n' -u "myusername:mypassword" -F 'fileToUpload=@./126438386X.tiff' https://coversadmin-prod.mhedu.com/supload.php
This will result in the status code as the second line of output:
{"status":"success","status_message":"image file is valid. uploaded successfully. archived successfully. recorded successfully"}
200