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

need help #1210

Open
jaymarmagbutong opened this issue Jan 8, 2025 · 1 comment
Open

need help #1210

jaymarmagbutong opened this issue Jan 8, 2025 · 1 comment
Labels

Comments

@jaymarmagbutong
Copy link

how to insert image in the database using this approach

const config = useMemo(() => ({
readonly: false,
toolbar: true,
uploader: {
insertImageAsBase64URI: true,
url: '/api/upload/',
method: 'POST',
filesVariableName: () => "file",
isSuccess: (resp) => resp.link,
process: (resp) => ({
files: [{ url: resp.link }],
}),
onError: (error) => {
console.error("Upload failed:", error);
toast.error("Image upload failed");
},
},
}), []);

@xdan
Copy link
Owner

xdan commented Jan 26, 2025

With this configuration, the image is inserted directly into html as a base64 string.

@xdan xdan added the question label Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants