Home
Support Forums

I keep getting empty file with netlify forms when I am expecting to see path to image file

I am using Single Page App with React.

In the index.html file:

In the index.jsx file:

      <p className="hidden">
        <label>Don’t fill this out if you’re human: <input name="bot-field" /></label>
      </p>

      <p>
        <label htmlFor="email">Email</label> <br />
        <input type="text" id="email" name="email" required />
      </p>
      <p>
        <label htmlFor="wallet">Wallet address:</label> <br />
        <input type="text" id="wallet" name="wallet" required />
      </p>
      <p>
        <label htmlFor="wallet-confirm">Confirm wallet address:</label> <br />
        <input type="text" id="wallet-confirm" name="wallet-confirm" required />
      </p>
      <p>
        <label htmlFor="myfile">Add file:</label> <br />
        <input name="myfile" id="myfile" type="file" placeholder="upload file" required />
      </p>
      <p>
        <label>
          Let's make it weird?: <input type="checkbox" id="weird" name="weird" value="Make it weird" />
        </label>
      </p>
      <p>
        <input type="submit" value="Submit message" />
      </p>
    </form>

When I submit the form and I am getting empty file:

Screen Shot 2021-12-28 at 12.28.35 AM

I am expecting to see the path to image file rather than empty.

Site address: https://61cac7803811e50008dbb4f3--ecstatic-hopper-43fe6f.netlify.app/

Hi @colesanderson

Check out this post for a example React file-upload (with GitHub repository link) including using a dropzone

1 Like

awesome thank you that fixed my issue :slight_smile: