Just skimming over your source (as you didn't describe what went wrong) the following lines stick out as a simple error:
sprintf(buffer,"%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"\r\n",boundary,nameForm,filename);
sprintf(buffer,"%sContent-Type: %s\r\n",buffer,type);
sprintf(buffer,"%s%s",buffer,content);
sprintf(buffer,"%s--%s--\r\n",buffer,boundary);
The second and third sprintf do not append to what you already have written, but overwrite it! Either use a single sprintf to do it all, or keep a pointer to where the next sprintf should go:
char* p = buffer;
p += sprintf (p, "....", ....);
p += sprintf (p, "....", ....);
Of course, the above code is just for clarity. In a real application you would need to do some error checking as sprintf may return -1 in case of an error.