Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
940 views
in Technique[技术] by (71.8m points)

netlify - How to download external file on gatsby site?

I have a gatsby site deployed to Netlify with IPv6 enabled

For some reason when trying to download a file, it fails.

I have setup the following link

<a href="http://myexternafilelLink" download> Download</a>

The external link being a Cludinary url

http://res.cloudinary.com/clinic-plus/raw/upload/v1609936226/Man_Job_Spec_ClinicPlus_ysaoiz_1_z27rtq.xlsx

When I click this nothing happens, the only thing I see is the tab reload icon runing and then it stops and nothing happens.

I have confirmed the link works.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Just remove your AdBlock (or whitelist the domain). I've tested it in a browser with both configurations and I can confirm that the links work. I also would suggest adding a target="_blank" property.

<a href="http://res.cloudinary.com/clinic-plus/raw/upload/v1609936226/Man_Job_Spec_ClinicPlus_ysaoiz_1_z27rtq.xlsx" target="_blank" download> Download</a>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...