How to display a image selected from input type = file in reactJS

Hook version: const [image, setImage] = useState(null) const onImageChange = (event) => { if (event.target.files && event.target.files[0]) { setImage(URL.createObjectURL(event.target.files[0])); } } return ( <div> <input type=”file” onChange={onImageChange} className=”filetype” /> <img alt=”preview image” src={image}/> </div> ) Class version render() { return ( <div> <input type=”file” onChange={onImageChange} className=”filetype” /> <img alt=”preview image” src={this.state.image}/> <div/> ) } onImageChange … Read more

Twitter Bootstrap Form File Element Upload Button

Here’s a solution for Bootstrap 3, 4, and 5. To make a functional file input control that looks like a button, you only need HTML: HTML <label class=”btn btn-default”> Browse <input type=”file” hidden> </label> This works in all modern browsers, including IE9+. If you need support for old IE as well, please use the legacy … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)