Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
tratando de crear un cargador ipfs img obteniendo este error: "Error de tipo no detectado: no se pueden leer las propiedades de undefined (leyendo '0')"

este es mi código app.js pasando por un código de carga de imágenes ipfs junto con un video de la universidad dapp. frente a este problema soy nuevo en blockchain creo que hay un problema con esta línea de código const file = event.target.files[0]

 captureFile(event) { event.preventDefault() const file = event.target.files[0] const reader = new window.FileReader() reader.readAsArrayBuffer(file) reader.onloadend = () => { this.setState({ buffer: Buffer(reader.result) }) console.log('buffer', this.state.buffer) } } onSubmit(event){ event.preventDefault() console.log("on submit......") ipfs.default.files.add(this.state.buffer,(err, result)=>{ if(err){ console.err("belp") return } this.setState({ipfshash:result[0].hash}) console.log("ipfshash",this.state.ipfshash) }) //api installed accessed in header } render() { if (!this.state.web3) { return <div>Loading Web3, accounts, and contract...</div>; } return ( <div className="App"> <h1>IPFS UPLOADER DAPP!</h1> <p>THIS IMAGE IS STORED IN IPFS.</p> <img src ="" alt=""/> <h2>upload image:</h2> <form onSubmit={this.onSubmit} > <input type='file' onChange={this.captureFile}/> <input type='submit'/> </form> {/* <p> Try changing the value stored on <strong>line 42</strong> of App.js. </p> <div>The stored value is: {this.state.storageValue}</div> */} </div> ); } } export default App;
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!