You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 10, 2021. It is now read-only.
ENH: refs #236. Forbid duplicate content uploads via web API
midas.upload.generatetoken now requires a checksum parameter. If we already
have a bitstream with the provided checksum, we don't create an upload token;
instead we create a pointer to the existing content within the specified item
and return an empty token to let the user know that they don't need to call
the upload.process function.
Copy file name to clipboardExpand all lines: modules/api/controllers/components/ApiComponent.php
+38-4Lines changed: 38 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -192,11 +192,12 @@ function resourceSearch($args)
192
192
* @param token Authentication token
193
193
* @param itemid The id of the parent item to upload into
194
194
* @param filename The filename of the bitstream you will upload
195
-
* @return An upload token that can be used to upload a file
195
+
* @param checksum The md5 checksum of the file to be uploaded
196
+
* @return An upload token that can be used to upload a file. If the token returned is blank, the server already has this file and there is no need to upload.
0 commit comments