Replies: 1 comment
-
you can have your own backend uploader, in the grapesjs this should be it grapesjs.init({
//...
assetManager: {
multiUpload: false,
uploadFile: async(ev: DragEvent) => {
const files = ev.dataTransfer ? ev.dataTransfer.files : (ev.target as HTMLInputElement)?.files;
if (!files) return;
const formData = new FormData();
formData.append("file", files[0]);
try {
// your API endpoint
const response = await fetch("/api/S3Uploader", {
method: "POST",
body: formData
});
const result = await response.json();
// add recently uploaded file to the assets manager
editor.AssetManager.add(result?.fileUrl);
} catch (error) {
console.log(error);
}
}
}
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am not able to find a way to Upload assets to amazon s3 bucket
is there is any example, I have seen default example with upload URL, but I have bucket-name, secure key, and other things
pre signed URL etc, just s3 things.
Beta Was this translation helpful? Give feedback.
All reactions