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

base64 decoding #5

Open
Tbonexas opened this issue Jan 14, 2021 · 4 comments
Open

base64 decoding #5

Tbonexas opened this issue Jan 14, 2021 · 4 comments

Comments

@Tbonexas
Copy link

Tbonexas commented Jan 14, 2021

First and foremost, amazing project! Thank you so much for showing this MERN project as it has helped me so much with my understanding as a student!

On the server side when I get the callback for the uploaded images base64 gives an extremely large string per image that at times (unless I don't touch vscode) causes a crash if there is a few pictures uploaded and I refresh the page. Is there anyway to shorten it within the fileBase component to make the string decoded so it's not so long? I was looking at the documentation for it and it seems to need an "onDone={this.getFile.bind(this)} " to maybe shorten the string within the <FileBase ........ /> on Form.js? but I cannot for the life of me figure out how to get it to work.
Again, thank you so much for this I subbed to your channel and look forward to more upload from you!

issue
image

@themr97
Copy link

themr97 commented Mar 21, 2021

Just remove " console.log(postMessages); " from server/controllers/posts.js

@Tbonexas
Copy link
Author

Tbonexas commented Apr 2, 2021

I found that. I was wondering if there was a way to make the string smaller (or encoded) through base 64. Thank you for the reply I appreciate it.

@alejandro-alcaide
Copy link

The string is the image's representation in base 64, actually. I also posted very big images and my log became glitchy, too.
If you want to see how many posts you are finding, you can change the console.log(postMessages) to (postMessages.length).

@Tbonexas
Copy link
Author

Awesome! thank you I will give that a try. When I finished the project i ended up commenting out the console.log so it would function for demonstration without the lag or glitching. Thank you for the reply it is appreciated.

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

No branches or pull requests

3 participants