How to download a local file in reactjs?

How to download a local file say demo.txt stored in d drive. From the server call, I am getting the local file location. How to download it on the onClick event?

133 thoughts on “How to download a local file in reactjs?”

  1. This is not related to React, you can use the download attribute on the anchor element to tell the browser to download the file.

    <a href='/somefile.txt' download>Click to download</a>
    
    Reply
  2. Pingback: sildenafil 85
  3. I’ll immediately take hold of your rss feed as I can not to find your e-mail subscription hyperlink
    or e-newsletter service. Do you’ve any?

    Please let me realize so that I may just subscribe.
    Thanks.

    Reply
  4. I have been surfing on-line more than three hours nowadays, but
    I by no means discovered any fascinating article like yours.
    It’s beautiful worth sufficient for me. Personally, if all webmasters and bloggers
    made good content material as you did, the
    web will be much more useful than ever before.

    Reply
  5. I have been browsing online more than 4 hours today,
    yet I never found any interesting article like yours. It is pretty worth enough for me.
    In my view, if all webmasters and bloggers
    made good content as you did, the net will be a lot
    more useful than ever before.

    Reply
  6. Hi, i read your blog occasionally and i own a similar one and i was just
    curious if you get a lot of spam feedback? If so how do you stop
    it, any plugin or anything you can recommend? I get so
    much lately it’s driving me mad so any support is very much appreciated.

    Reply
  7. I have been surfing on-line greater than three hours today, but I never found any interesting article like yours.
    It’s pretty value sufficient for me. Personally, if all web owners and bloggers made good content material as you probably did, the net can be much
    more helpful than ever before.

    Reply
  8. Pingback: amoxicillin dosage
  9. Pingback: celecoxib 100mg
  10. Hey would you mind letting me know which hosting company
    you’re working with? I’ve loaded your blog in 3
    completely different browsers and I must say this blog loads a lot quicker then most.
    Can you recommend a good web hosting provider at a reasonable price?
    Kudos, I appreciate it!

    Reply
  11. Hey would you mind letting me know which webhost you’re working with?
    I’ve loaded your blog in 3 different web browsers and I
    must say this blog loads a lot faster then most.
    Can you suggest a good web hosting provider
    at a reasonable price? Thanks a lot, I appreciate it!

    Reply
  12. It is perfect time to make some plans for the future and it is time to be
    happy. I’ve learn this submit and if I could I want
    to counsel you some attention-grabbing issues or advice.
    Maybe you can write subsequent articles regarding this article.
    I wish to learn more issues approximately it!

    Reply
  13. Hi there would you mind stating which blog platform you’re working with?

    I’m looking to start my own blog in the near future but I’m having a difficult time deciding between BlogEngine/Wordpress/B2evolution and
    Drupal. The reason I ask is because your layout seems different then most blogs and I’m looking for something unique.

    P.S Apologies for getting off-topic but I had to ask!

    Reply
  14. I have been browsing online more than three hours today, yet I never found any interesting article like yours.
    It is pretty worth enough for me. Personally, if all webmasters and bloggers made good content
    as you did, the web will be a lot more useful than ever before.

    Reply
  15. It’s the best time to make some plans for the future and it’s time to be happy.
    I have read this post and if I could I wish to suggest you
    few interesting things or tips. Maybe you can write next
    articles referring to this article. I wish to read more things about it!

    Reply
  16. Greetings from Los angeles! I’m bored at work so I decided to
    check out your website on my iphone during lunch break.
    I really like the info you provide here and can’t wait
    to take a look when I get home. I’m surprised at how quick your
    blog loaded on my mobile .. I’m not even using WIFI, just
    3G .. Anyhow, great site!

    Reply
  17. It’s appropriate time to make some plans for the
    future and it’s time to be happy. I’ve read this post and if I could I desire to suggest you few interesting things or suggestions.
    Maybe you can write next articles referring to this article.
    I wish to read more things about it!

    Reply
  18. I’ve been browsing on-line more than three hours
    as of late, but I never found any attention-grabbing article like yours.
    It is lovely price enough for me. In my view, if all webmasters and bloggers made
    excellent content as you probably did, the internet
    can be a lot more useful than ever before.

    Reply
  19. I have been surfing on-line greater than three hours nowadays, yet I
    never discovered any attention-grabbing article like yours.

    It’s pretty worth sufficient for me. In my view, if all site owners and bloggers made just right content material as you
    probably did, the net will probably be much more useful than ever before.

    Reply
  20. I have been browsing online more than 4 hours today, yet I never
    found any interesting article like yours. It is pretty worth enough for me.
    In my view, if all website owners and bloggers made good content as you did, the internet will be
    a lot more useful than ever before.

    Reply
  21. It’s perfect time to make a few plans for the long run and it’s time
    to be happy. I have read this put up and if I could I wish to recommend you some attention-grabbing things or tips.
    Perhaps you could write subsequent articles relating to this article.

    I wish to learn even more issues about it!

    Reply
  22. My spouse and I absolutely love your blog and find the majority of your post’s to
    be exactly what I’m looking for. can you offer guest writers to write content for you personally?
    I wouldn’t mind producing a post or elaborating on some of the subjects
    you write regarding here. Again, awesome web log!

    Reply
  23. I will right away take hold of your rss as I can not find your e-mail subscription hyperlink or newsletter service.
    Do you have any? Please let me know in order that I may subscribe.

    Thanks.

    Reply
  24. I’ll immediately clutch your rss feed as I can not to find your
    email subscription link or e-newsletter service. Do you
    have any? Kindly allow me understand in order that I may subscribe.
    Thanks.

    Reply
  25. Hi there just wanted to give you a quick heads up. The words in your post seem to be running off the screen in Safari.
    I’m not sure if this is a format issue or something to do with internet browser compatibility but I figured I’d post to let you know.

    The design look great though! Hope you get the problem fixed
    soon. Thanks

    Reply
  26. It’s appropriate time to make some plans for the future and it’s time to be happy.
    I have read this post and if I could I want to suggest you few interesting things or
    advice. Perhaps you can write next articles referring to this article.
    I wish to read more things about it!

    Reply
  27. Unquestionably believe that which you stated. Your favorite justification appeared to
    be on the web the easiest thing to be aware of. I say to you,
    I certainly get annoyed while people consider worries that they
    plainly don’t know about. You managed to hit the nail upon the
    top and also defined out the whole thing without having side effect , people could take a signal.
    Will probably be back to get more. Thanks

    Reply
  28. I’ve been browsing online more than 3 hours today, yet I never found any interesting article like yours.
    It is pretty worth enough for me. In my opinion, if
    all site owners and bloggers made good content as you did, the net will be
    much more useful than ever before.

    Reply
  29. It is the best time to make some plans for the future
    and it is time to be happy. I’ve read this post and if I may just I wish to counsel you few attention-grabbing issues or tips.
    Perhaps you can write subsequent articles relating to this article.
    I wish to read more issues approximately it!

    Reply

Leave a Comment