首先,将本地字体名称列表POST到服务器,服务器会比较服务器上的字体列表,并将需要上传的字体列表通过JSON数据返回。
然后,客户端收到字体列表后,将需要上传的字体压缩打包,通过WEB API上传到服务器端。
boolupload_file(constwstringpath) {CURL*curl;CURLcoderes;structcurl_httppost*formpost=NULL;structcurl_httppost*lastptr=NULL;curl_formadd(&formpost, &lastptr,CURLFORM_PTRNAME,"file",CURLFORM_FILE,WStringToString(path).c_str(),CURLFORM_END);curl=curl_easy_init();if(curl) {curl_easy_setopt(curl,CURLOPT_URL,UploadCadFontUrl.c_str());curl_easy_setopt(curl,CURLOPT_HTTPPOST,formpost);res=curl_easy_perform(curl);curl_easy_cleanup(curl);_wremove(path.c_str());return true; }_wremove(path.c_str());return false; }
盖楼回复 X
(您的评论需要经过审核才能显示)