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

User should be able to send image. #309

Open
muke1908 opened this issue Jul 6, 2023 · 4 comments
Open

User should be able to send image. #309

muke1908 opened this issue Jul 6, 2023 · 4 comments
Assignees
Labels
frontend medium Pull request is medium

Comments

@muke1908
Copy link
Owner

muke1908 commented Jul 6, 2023

Convert image to base64 and send it by calling await chatInstance.encrypt('some message').send();
https://github.com/muke1908/chat-e2ee/blob/master/service/README.md#3-send-message

@muke1908 muke1908 added frontend medium Pull request is medium labels Jul 6, 2023
@suman313
Copy link
Contributor

suman313 commented Jul 7, 2023

Hi @muke1908 , I want to work on this issue.
Can you assign me?

@muke1908 muke1908 assigned muke1908 and suman313 and unassigned muke1908 Jul 7, 2023
@muke1908
Copy link
Owner Author

muke1908 commented Jul 7, 2023

sure, thanks

@suman313
Copy link
Contributor

suman313 commented Oct 1, 2023

Hi @muke1908 ,
I have checked the client side for the image sending. What I can see in "client/src/utils/imagePicker.tsx" we have :
image
where the selected image is already converted to base64 and it is sending to the server as base64 encoded string.
So in my opinion there is no problem here.
What I can figure out is the problem is while uploading the image in the server in "backend/externals/imgbb.ts" it cannot find the access to "IMAGE_BB_API_KEY"

  const form = new FormData();
  form.append("image", imageData);
  const url = `${api}?expiration=600&key=${API_KEY}`;

  const response = await fetch(url, {
    method: "POST",
    body: form
  });
  const imageResponse: any = await response.json();

@muke1908
Copy link
Owner Author

muke1908 commented Oct 2, 2023

Hi, @suman313 right we already have image picker that convert image to base64 and sends it to the server. But we want to be able to encrypt it with await chatInstance.encrypt(<base64 image>).send() .
Also, we do not want to use ImageBB to store images, the image should not be stored anywhere in that aspect.

But I guess there can be some issue on receiver side as websocket has a limit on payload size - but we'll deal with it separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend medium Pull request is medium
Projects
None yet
Development

No branches or pull requests

2 participants