muke1908 / chat-e2ee

End-to-end encrypted disposable chat sessions, exchange sensitive information with peer safely and securely.
https://chat-e2ee-2.azurewebsites.net/
Apache License 2.0
322 stars 196 forks source link

User should be able to send image. #309

Open muke1908 opened 1 year ago

muke1908 commented 1 year ago

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

suman313 commented 1 year ago

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

muke1908 commented 1 year ago

sure, thanks

suman313 commented 11 months ago

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 commented 10 months ago

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.