Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Upload): adds custom href property to file object #4362

Closed
wants to merge 2 commits into from

Conversation

langz
Copy link
Contributor

@langz langz commented Dec 5, 2024

No description provided.

Copy link

vercel bot commented Dec 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
eufemia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 2:08pm

@langz langz changed the title feat(Upload): adds custom href property feat(Upload): adds custom href property Dec 5, 2024
@langz langz changed the title feat(Upload): adds custom href property feat(Upload): adds custom href property to file object Dec 5, 2024
Copy link

codesandbox-ci bot commented Dec 5, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@torryt
Copy link

torryt commented Dec 5, 2024

This looks like an elegant solution 🤩 Question: if the file URL resource requires authentication through cookies, will the cookies be forwarded with this approach?

@torryt
Copy link

torryt commented Dec 6, 2024

@langz We've done some searching on this, and cookies are not included in CORS requests. In our frontend API client we add credentials: 'include' to ensure cookies are passed along. Therefore this approach would not work for us, since the href don't allow any custom HTTP client logic as I understand it.

@langz
Copy link
Contributor Author

langz commented Dec 6, 2024

@langz We've done some searching on this, and cookies are not included in CORS requests. In our frontend API client we add credentials: 'include' to ensure cookies are passed along. Therefore this approach would not work for us, since the href don't allow any custom HTTP client logic as I understand it.

Thanks for checking 🤝
I can quite quickly change this to a onFileClick handler which you can use programatically to do what you want.

However in regards to #4355 and not having to pre-loaded all files in the form data, I think that I would have to make changes other places in the code base as well so the form will still be valid even though the form does not have the full file, etc, etc.

@langz
Copy link
Contributor Author

langz commented Dec 6, 2024

I've replaced this PR with the following PR #4365

@langz langz closed this Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants