aws-s3
aws-s3 copied to clipboard
Cannot read property 'split' of undefined
My code: following the documentation to the dot. Can't figure out what the error is.
function ImageSubmit(event){ console.log(event.target.files[0]) let file = event.target.files[0].name S3Client.uploadFile(file) .then(data => console.log("X", data)) .catch(err => console.error(err)) }
My error:
index.js:1 TypeError: Cannot read property 'split' of undefined at s.uploadFile (aws-s3.js:1) at ImageSubmit (AddCarPage.js:72) at HTMLUnknownElement.callCallback (react-dom.development.js:336) at Object.invokeGuardedCallbackDev (react-dom.development.js:385) at invokeGuardedCallback (react-dom.development.js:440) at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:454) at executeDispatch (react-dom.development.js:584) at executeDispatchesInOrder (react-dom.development.js:609) at executeDispatchesAndRelease (react-dom.development.js:713) at executeDispatchesAndReleaseTopLevel (react-dom.development.js:722) at forEachAccumulated (react-dom.development.js:694) at runEventsInBatch (react-dom.development.js:739) at runExtractedPluginEventsInBatch (react-dom.development.js:880) at handleTopLevel (react-dom.development.js:5803) at batchedEventUpdates$1 (react-dom.development.js:24401) at batchedEventUpdates (react-dom.development.js:1415) at dispatchEventForPluginEventSystem (react-dom.development.js:5894) at attemptToDispatchEvent (react-dom.development.js:6010) at dispatchEvent (react-dom.development.js:5914)
@codeghees I have this issue too. Did you solve it?
Yeah - I was sending just the name - send the entire object. @sarykemmoun2
can you please help me solving this as well ? i am getting the same error cannot read property split of undefined