Hi Rui,
I just searched "failed creating formpost data" in Google and there is plenty of people having the same issue. Apparently it's because curl fail to read/access(/write) your file. Try to test with the full imagepath starting with '/' or 'c:/' not with '.'.
cheers,
Jerome