Skip to content
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

Images getting corrupted on download #36

Open
MohammadMasood opened this issue Dec 1, 2016 · 0 comments
Open

Images getting corrupted on download #36

MohammadMasood opened this issue Dec 1, 2016 · 0 comments

Comments

@MohammadMasood
Copy link

When I try to download images using FileSaver.SaveAs it is downloaded but cannot see image .

            var self = this;
            var url = this.getUrl(apiUrl, itemPath);		
            var deferred = $q.defer();
            self.inprocess = true;
            $http.get(url).success(function(data,status,headers) {
				var response = {
					content_type:headers('Content-Type'),
					data:data,
				};

				var data_cnt = new Blob([data], { type:response.content_type });
				FileSaver.saveAs(data_cnt, toFilename,false);
		
                deferred.resolve();
              
            }).error(function(data, code) {
                self.deferredHandler(data, deferred, code, $translate.instant('error_downloading'));
            })['finally'](function() {
                self.inprocess = false;
            });
            return deferred.promise;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant