char *query=(char*)malloc(2048); strcpy(query,"POST /"); strcat(query, http_path); strcat(query," HTTP/1.1\nHost: "); strcat(query, http_host); strcat(query,"\nAccept: text/html,application/xhtml+xml,application/xml, image/gif, image/x-xbitmap, image/jpeg, image/pjpeg; q=0.9 */*;q=0.8"); strcat(query,"\nAccept-Language: en-us,en;q=0.5"); strcat(query,"\nAccept-Encoding: gzip,deflate"); strcat(query,"\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7"); strcat(query,"\nUser-agent: Mozilla/5.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)\n"); strcat(query,"\nContent-Type: application/x-www-form-urlencoded"); strcat(query,"\nContent-Disposition: multipart/form-data; name=\"imagefile\"; filename=\"C:\\test123.jpg\""); strcat(query,"\nContent-Type: image/jpeg\n"); int cnt=send(s,query,strlen(query),0); |