Hi.
I have this code:
const fileBody = `------${uuid}
Content-Disposition: form-data; name="file"; filename=${file.name}
Content-Type: application/pdf
${newFile}
------${uuid}--`;
const fileUploadResponse = await fetch(formUrl, {
method: "POST",
headers: {
Authorization: bearerToken ?? "",
Cookie: xsrfCookie,
"Content-Type": `multipart/form-data; boundary=------${uuid}`,
"X-XSRF-TOKEN": csrfToken ?? "",
},
body: fileBody,
});
I'm trying to upload the file to my submission. I have successfully added
the traditionalpageone and the license items, but I can't upload the file.
I get this missage: Response { status: 400,
statusText: '',
headers:
Headers { date: 'Mon, 14 Apr 2025 09:23:04 GMT',
server: 'Apache',
vary:
'Origin,Access-Control-Request-Method,Access-Control-Request-Headers',
'content-language': 'ca,es,en',
'x-content-type-options': 'nosniff',
'x-xss-protection': '0',
'cache-control': 'no-cache, no-store, max-age=0, must-revalidate',
pragma: 'no-cache',
expires: '0',
'strict-transport-security': 'max-age=31536000 ; includeSubDomains',
'x-frame-options': 'DENY',
'content-type': 'application/problem+json;charset=UTF-8',
'content-security-policy': "frame-ancestors 'self';",
'access-control-expose-headers':
'Authorization, expires, Location, Content-Disposition,
WWW-Authenticate, Set-Cookie, X-Requested-With, DSPACE-XSRF-TOKEN',
'access-control-allow-origin': 'https://new-bcnroc.metricsalad.com',
'access-control-allow-credentials': 'true',
'access-control-allow-methods': 'PUT, GET, POST, DELETE, OPTIONS,
PATCH',
connection: 'close',
'transfer-encoding': 'chunked' },
body: ReadableStream { locked: false, state: 'readable', supportsBYOB:
true },
bodyUsed: false,
ok: false,
redirected: false,
type: 'basic',
url:
'https://api-new-bcnroc.metricsalad.com/api/submission/workspaceitems/143964'
}
Can you help me to solve it?
--
All messages to this mailing list should adhere to the Code of Conduct:
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
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 [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/dspace-tech/32630a79-0a1d-4433-9c46-7775340793dan%40googlegroups.com.