-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filename attr is not woking in Safari #29
Comments
Hi, I hope they will solve this soon enough, I'll check up on this in the next On Tue, May 27, 2014 at 9:58 AM, jeonghwan notifications@github.com wrote:
|
Thank you for comment. :D |
The Chromium team merged the issue into this one https://code.google.com/p/chromium/issues/detail?id=373182 It should be fixed in a week or two. let's cross our fingers. |
I expect. |
Same issue. Hoping for a resolution. |
According to issue above, they solved it today, so we should expect a fix soon. |
I'm using chrome Version 35.0.1916.153 latest. When I click on export, it always choose "download.csv" as the filename even if I have the filename="export.csv" attribute set. Also, I have the same issue as mentioned above where safari opens the CSV in a new tab. |
I am facing the same issue with Chrome and Safari. Do we have any work around at this moment? |
Hi, I don't have a good solution for Safari at the moment, as currently they As I mentioned above, The chrome team already solved the issue and the next On Wed, Jul 9, 2014 at 7:54 AM, Aditya Sabnis notifications@github.com
|
hi, for a rapid solution of chrome problem, you can modify ng-csv.js else in line 211 for that
|
UPDATE: The latest version of chrome works as expected |
Thanks I will check it. |
Any updates about this? On safari i will get printed output, not a downloaded file.. |
Same here, safari doesn't download the file. Any idea how to work around this issue? |
how it's going? |
This is because Safari doesn't allow downloading of blob urls. So FileSaver.js using base64data in case of Safari browser. How about using this code on Safari in our project? if (isSafari()) {
downloadContainer = angular.element('<div data-tap-disabled="true"><a></a></div>');
downloadLink = angular.element(downloadContainer.children()[0]);
// Safari doesn't allow downloading of blob urls
var reader = new FileReader();
reader.readAsDataURL(blob);
reader.onloadend = function() {
var base64data = reader.result;
downloadLink.attr('href', 'data:attachment/file' + base64data.slice(base64data.search(/[,;]/)));
};
$document.find('body').append(downloadContainer);
$timeout(function () {
downloadLink[0].click();
downloadLink.remove();
}, null);
} |
Has there been any progress on this issue? |
So I've been doing some research into this. It looks like Safari doesn't support the download attribute used in the dynamically created element in the directive's link function. From what I've been able to find, other developers have either directed their users through non-intuitive right-click then "save page as" or create a content stream that still results in losing the filename. I'll keep looking into this and if I find a work around or something that looks like it fits into ng-csv's without a lot of bloat I'll let yall know / make a pull request. |
I'm afraid I've had something higher priority come up but if I have a chance I'll get back to this. |
@asafdav - seems that Chrome 48.0.2564.116m on windows10 still doesn't have extname on the file. |
It's working like a charm on chrome. |
@jeonghwan-kim I tried your code but unfortunately it didn't worked. Did you find a solution for it? |
|
@diego-oliveira : @jeonghwan-kim 's solution works fine when taken as a whole. @asafdav If there's something wrong with the above (besides that it's not a pull request) or with @karrde00 's pull request, please comment on them - I'd be happy to help clean up, etc., if needed. |
@jnelson I'll give it a shoot again and see if it was some mistake from my side. Thanks. |
@diego-oliveira If you prefer the iframe approach, we have an up-to-date merge of @karrde00's pull request at https://github.com/xlhybridsOSS/ng-csv/tree/github_karrde00-master - initial testing against IE11 and Safari 9.1 for our immediate problem has been successful. |
Thanks guys for working on this! We just ran into an issue where a client tried to download our data in CSV on Safari and it did not work :( |
Has anyone managed to get either of the above solutions working on Safari for iPad / iPhone? Nothing happens when I click my save button using @jeonghwan-kim 's solution and I get an "unable to read file" error using @karrde00 's solution. I also cannot download using the Android built-in browser, using any solution. It works in Chrome for Android though. Haven't seen anyone else mention this problem... |
+1 |
5 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
|
+1, any news? |
@Novarg I tried commenting on that line that you mention and it works in Safari and Chrome, you should do a pull request with that change |
+1 |
1 similar comment
+1 |
Thank you for this code (ng-csv). I used it in my project.
However, in Safari, csv file is not download. It is printed in Safari browser's new tab.
Aslo in Chrome browser filename attr is not working.
(Firefox is ok)
The text was updated successfully, but these errors were encountered: