We're using an Ajax based reporting package that I'm able to enhance with my own bits of jQuery/javascript. One of the problems we're encountering with this package is that it generates hyperlinks that look like:
<a href="//server/abcdefghijklmnopqrstuvwxyz.xlsx" target="_blank">
Since the client's browser doesn't know what to do with .xlsx files, it downloads them to their local drive. That's fine. The problem is that the client hates those long file names and would like to have them replaced with something shorter (for the sake of argument, let's say "abc.xlsx").
I can't just change the href because the server needs the long name to identify the data being returned, so what I need is a way to execute the GET using the original URL but then change the name of the returned file so that it is stored locally using the shorter name.
I know how to use jQuery to override the hyperlink's click function and use $.get() to obtain the data. What I don't know is what I should do once I've gotten the data to change it's apparent filename.