I am currently working on a Stream-Chat API project, and I want the users to be able to upload an image directly from their device. When I have tested it, everything goes without issue, but the image doesn't get displayed, only the default avatar of the first user's letter. Is there any way to fix it?
This is the code which handles the image input:
{isSignup && (
<div className="auth__form-container_fields-content_input">
<label htmlFor="avatarURL">Profile Picture</label>
<input
name="avatarURL"
type="file"
accept="image/apng, image/avif, image/gif, image/jpeg, image/png, image/svg+xml, image/webp"
placeholder="Avatar URL"
onChange={handleChange}
required
/>
</div>
)}
This is the handleChange function:
const handleChange = (e) => {
setForm({ ...form, [e.target.name]: e.target.value });
}
When I check the backend all it says is:
C:\fakepath\image.png