bitsream name is loaded as null through API from Postman

14 views
Skip to first unread message

Ponniah MANIKANDAN D

unread,
Jan 24, 2020, 8:32:25 AM1/24/20
to DSpace Technical Support
 When I try to upload a file to bistream using API, I did POST from postman adding the file under body. The file  is successfully uploaded, but the name is null.

Ayuka Phanuel

unread,
Jan 24, 2020, 11:40:02 AM1/24/20
to Ponniah MANIKANDAN D, DSpace Technical Support
Alongside the file object in your post, pass the name of the file as parameter. You can extract the file name from the file object.
In Python, have a look at the snippet below.
requests.post(url,
files={file_name: file_object},
params={'name': file_name},
headers={'Content-Type': 'multipart/form-data'},
cookies={"JSESSIONID": ""})

Kind Regards, 
Phanuel Ayuka.
Systems Developer - Android | Django | Java EE | ODK Aggregate | PHP


On Fri, Jan 24, 2020 at 4:32 PM Ponniah MANIKANDAN D <ponniahm...@gmail.com> wrote:
 When I try to upload a file to bistream using API, I did POST from postman adding the file under body. The file  is successfully uploaded, but the name is null.

--
All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/7cf4daea-5389-4863-87c0-cfa9faf06753%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages