Skip to content
Snippets Groups Projects
Commit 2ca2b5b0 authored by Bruno Nocera Zanette's avatar Bruno Nocera Zanette
Browse files

Update POST_new-bitstream rqst to accept filename

Also, it fixes a bug that adds multipart header to the uploaded file.
This bug is fixed by changing: -F upload=@"${FILE}" to -T "${FILE}"
parent da93231b
No related branches found
No related tags found
No related merge requests found
......@@ -3,5 +3,7 @@
# {"id":37,"name":null,"handle":null,"type":"bitstream","link":"/RESTapi/bitstreams/37","expand":["parent","policies","all"],"bundleName":"ORIGINAL","description":null,"format":"Unknown","mimeType":"application/octet-stream","sizeBytes":99021,"parentObject":null,"retrieveLink":"/bitstreams/37/retrieve","checkSum":{"value":"791274902ccd308c8a411e0d3395ec03","checkSumAlgorithm":"MD5"},"sequenceId":-1,"policies":null}
VERB="POST"
ACTION="items/11/bitstreams"
FILE="/home/bruno/C3SL/projeto-mec/testes-rest/v_ShellScript/requests/files/pdf1.pdf"
ACTION="items/15/bitstreams"
FILE="./requests/files/pdf1.pdf"
PARAMS='name=TESTE.txt&description=DESCRIPTION_WITHOUT_SPACES!!'
......@@ -22,5 +22,5 @@ fi
curl -k -4 \
-H "rest-dspace-token: ${TOKEN}" \
-H "accept: application/${REQUEST_TYPE}" \
-X ${VERB} "${DSPACEURL}/${ACTION}" \
-F upload=@"${FILE}"
-X ${VERB} "${DSPACEURL}/${ACTION}?${PARAMS}" \
-T "${FILE}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment