-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
document file detection workaround #2202
- Loading branch information
Showing
1 changed file
with
2 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -444,6 +444,8 @@ A more detailed "add" example using curl:: | |
|
||
curl -H "X-Dataverse-key:$API_TOKEN" -X POST -F '[email protected]' -F 'jsonData={"description":"My description.","directoryLabel":"data/subdir1","categories":["Data"], "restrict":"true"}' "https://example.dataverse.edu/api/datasets/:persistentId/add?persistentId=$PERSISTENT_ID" | ||
|
||
Please note that it's possible to "trick" Dataverse into giving a file a content type (MIME type) of your choosing. For example, you can make a text file be treated like a video file with ``-F '[email protected];type=video/mpeg4'``, for example. If Dataverse does not properly detect a file type, specifying the content type via API like this a potential workaround. | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
Example python code to add a file. This may be run by changing these parameters in the sample code: | ||
|
||
* ``dataverse_server`` - e.g. https://demo.dataverse.org | ||
|
Would it be possible to give a more realistic example here and write it in a way that suggests a "best practice", as opposed to a "trick"...??