Replies: 1 comment 2 replies
-
hi @rohanm19 Im not sure exactly what you're trying achieve. When uploading with Uploady, the default upload is done using a POST request with formdata. You need to make sure your server knows how to handle multipart uploads (ex: Multer for Express on Node). Any data you wish to add to the upload can be done using the params prop. Dynamically adding params can be done easily with the Check out the Dynamic Parameters Guide for sample code. Let me know if something is still unclear |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
I am trying to use Uploady for a react app, and I am failing to understand how do I extract details like file name and contents to send to my node server.
In the following snippet, QueueItem is where I extract the information. the console logs look fine. But since it is part of UploadPreview props, I am not sure how the parent prop "destination" can access this before rendering.
Not sure if I am able to clearly articulate the problem. But for me both the filename and body is not set, I just get a blank file with 0 as the filename
`
useItemProgressListener(item => {
if (item.completed > progress) {
setProgress(() => item.completed);
setItemState(() =>
item.completed === 100 ? STATES.DONE : STATES.PROGRESS
);
}
console.log("item",item)
setFileName(item.file.name);
`
<Uploady // debug destination={{ url: '/s3createObject', headers: {'filekey': nodePath[nodePath.length-1].Key + fileName, 'accept': '*.jpg'}, params : {'body': uploadBody}} } // enhancer={composeEnhancers(mockSenderEnhancer)} > {/* <UploadProgress/> */} <UploadyButton></UploadyButton> <PreviewsContainer> <UploadPreview rememberPreviousBatches PreviewComponent={QueueItem} /> </PreviewsContainer> </Uploady>
Beta Was this translation helpful? Give feedback.
All reactions