I take it you're using Windows? Could you try using double quotes instead of single quotes?
curl -u admin:geoserver -v -XPUT -H "Content-type: application/zip" \
--data-binary @C:/x/test_data/localfile.zip \
I think the problem is that Windows is ignoring the Content type as it's enclosed in single quotes. Therefore, Geoserver does not treat the file as zip. From the Windows command shell documentation:
... any argument that contains spaces or begins or ends with
spaces must be enclosed in double quotes. This is particularly
important when using long file and directory names, which frequently
contain one or more spaces. If a double-quoted argument itself
contains a double quote character, the double quote must be doubled.
For example, enter "Quoted" Argument as """Quoted"" Argumen
Found this at the Geoserver mailing list.
Sometimes after repeated failed uploads some files can linger around
on the server that cause problems. Go to your GEOSERVER_DATA_DIRECTORY
and remove any lingering files from the "data" directory under it.
Then try again.
Hopefully, that should help solve your problem.