Hi,
I’m trying to move a file just after uploading it.
But the file is blocked and I can not use it until the Thread where ofxHttpUtils was initiated is finished.
What is the best way to unlock file and use it right in even handler?
ofxHttpUtils upload_httpUtils;
ofxHttpForm form;
form.action = upload_action_url;
form.method = OFX_HTTP_POST;
form.addFormField("filename", fileName);
form.addFormField("type", type);
form.addFile("file", filePath);
form.addHeaderField("Authorization", "Bearer " + OAuthToken);
upload_httpUtils.submitForm(form);
void parseUploadResponse(ofxJSONElement responseMessage) {
std::string mv_cmd = ("MOVE /Y " + filePath + " " + newPath);
system(mv_cmd.c_str());
}
The process cannot access the file because it is being used by another process.
0 file(s) moved.