Google Cloud Storage Force下载

Google Cloud Storage Force下载

问题描述:

我正在将文件存储在Google Cloud Storage中.我想提供可下载的链接.例如 https://yeketakclub.storage.googleapis.com/audios/yeketak .club-dm7aEYv7R53JRlti3HHn.mp3 存储在Google云存储中的音频文件之一.但是,当单击它时,浏览器会尝试将其打开.可以强制下载吗?

I am storing my files in Google Cloud Storage. I would like to provide downloadable links. For example https://yeketakclub.storage.googleapis.com/audios/yeketak.club-dm7aEYv7R53JRlti3HHn.mp3 one of audio files stored in google cloud storage. But when it is clicked browser tries to open it. Is it possible to force download?

我不确定这是否一定是Google Cloud Storage问题(我可能错了).此处提供的链接是可下载的.恰好是您的浏览器最喜欢播放它,因为它将MIME类型识别为可以处理的类型.

I'm not sure if this is necessarily a Google Cloud Storage issue (I might be wrong). The link provided there is downloadable. It just happens to be that your browser "prefers" to play it most probably because it recognises the MIME Type as one that can be handled.

例如,在Chrome中,您可以使用 alt + click 强制下载文件.

In Chrome for instance, you can force download of the file by using alt + click.

或者您可以右键单击并将链接另存为...

Or you can right click and save link as...