search

Home  >  Q&A  >  body text

When Android uploads a picture for the second time, it returns a 614 error, file exists, and the same key is passed. Why can't it be overwritten?

uploadManager = new UploadManager(config);

    String tokens =  token <已经是服务器获取的token >
    String data = imageTempPath;
    String key = "image_100.png";
    uploadManager.put(data, key, tokens,
            new UpCompletionHandler() {
                @Override
                public void complete(String key, ResponseInfo info, JSONObject res) {
                    if (info.isOK()) {
                        sendUpWeStoreLoadBg(key);
                    } else {
                        Toast.makeText(MicroStoreMainActivity.this, "上传失败", Toast.LENGTH_SHORT).show();
                    }
                }
            }, null);
}
为情所困为情所困2747 days ago826

reply all(1)I'll reply

  • 我想大声告诉你

    我想大声告诉你2017-06-13 09:25:40

    First, the name of your key is not good. It is recommended not to use this form.
    Second, the specific reason should be on the server side. It may store the Hash of the image. If the same image is detected, you will be rejected. Uploaded again to save traffic

    reply
    0
  • Cancelreply