瀏覽代碼

If a file with the given name already exits on the server set the overwrite flag to true

Andreas Fetzer 10 年之前
父節點
當前提交
5bf76b3b40
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Libs/XNAT/Core/ctkXnatFile.cpp

+ 4 - 0
Libs/XNAT/Core/ctkXnatFile.cpp

@@ -181,6 +181,10 @@ void ctkXnatFile::saveImpl()
   query.append(QString("&%1=%2").arg("format", this->fileFormat()));
   query.append(QString("&%1=%2").arg("format", this->fileFormat()));
   query.append(QString("&%1=%2").arg("content", this->fileContent()));
   query.append(QString("&%1=%2").arg("content", this->fileContent()));
   query.append(QString("&%1=%2").arg("tags", this->fileTags()));
   query.append(QString("&%1=%2").arg("tags", this->fileTags()));
+
+  if (this->exists())
+    query.append(QString("&%1=%2").arg("overwrite", true));
+
   query.append(QString("&%1=%2").arg("inbody", "true"));
   query.append(QString("&%1=%2").arg("inbody", "true"));
 
 
   this->session()->upload(filename, query);
   this->session()->upload(filename, query);