Js-file-download example get file name






















Dennis Dennis Not only Chrome anymore, it also works on my Firefox You can see the compatibility list here : caniuse. Works in Firefox starting in version ElonZito Should work for anything - it's just a file name. Is something not working that you expect to?

Show 2 more comments. Darin Dimitrov Darin Dimitrov k gold badges silver badges bronze badges. Although not client-side, this is the effect I wanted. Vibhu Vibhu 1 1 gold badge 3 3 silver badges 11 11 bronze badges. Sign up or log in Sign up using Google.

Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast what if you could invest in your favorite developer? Who owns this outage? Building intelligent escalation chains for modern SRE.

Featured on Meta. Now live: A fully responsive profile. Reducing the weight of our footer. Linked 6. See more linked questions. Viewed 37k times. How can I achive that? Felix Kling k gold badges silver badges bronze badges. Add a comment. Active Oldest Votes. As InviS suggests, now there's a download attribute on links. Dmitry Pashkevich Dmitry Pashkevich Any way to append the current user's date to the filename?

DaniSpringer you can try dynamically setting the attribute via the onclick handler, but there may be limitations — Dmitry Pashkevich. DmitryPashkevich thanks for your response. I asked today and got a pretty good answer. You can find the question via my account. I'm sure you know your way around SO. Stephani Bishop Stephani Bishop 1 1 gold badge 9 9 silver badges 17 17 bronze badges. Rob W Rob W k 76 76 gold badges silver badges bronze badges.

My guess of course — Truesky. I showed how the headers can be set. If he has the skills to program in PHP, he can alter the code to accomplish his goal. Use download attribute of the link. But it works only in Chrome browser :.

ValeriiVasin ValeriiVasin 8, 11 11 gold badges 55 55 silver badges 75 75 bronze badges. What's the reason that you want to rename the downloaded file anyway? Michael Sandino Michael Sandino 1, 1 1 gold badge 12 12 silver badges 9 9 bronze badges.

I have the files in a Sharepoint library and I'm trying to create a custom action to download the files and add the document version in the file name. To do this custom action I can only use javascript code. Any tips? Truesky Truesky 2 2 silver badges 11 11 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog.



0コメント

  • 1000 / 1000