Iframe download file complete






















Active Oldest Votes. ManojRana It is best to ask a new question. Alex Alex 9, 2 2 gold badges 29 29 silver badges 46 46 bronze badges. I suggest to separate the file generation from downloading. Just show loading screen till you receive the response for first call. Venkateswara Rao Venkateswara Rao 4, 1 1 gold badge 16 16 silver badges 12 12 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. Who owns this outage? Building intelligent escalation chains for modern SRE. Copy link.

For me success handler is firing but download popup is not showing. Contributor Author. The form plugin doesn't handle this download case. Thanks for the suggestion. Was pretty simple to extend form to handle the case. Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment. Linked pull requests. You signed in with another tab or window. Reload to refresh your session. Hey, I just noticed that occasionally this site shows a error.

I figured that you would like to know. All the best. I have implemented this in an asp. The first time, one dialog appears. The second time, two dialogs appear. The third time, three appear. And so on. When I refresh the page, it reset this. Why would this be? My fault. The click event was being bound multiple times to my button. I had to call unbind to make sure it was only bound once. Great tool! Any pointers? Nevermind, it appears to be that Chrome ignores this and always directly downloads.

Hello, yup this article is genuinely good and I have learned lot of things from it concerning blogging. I am using CodeIgniter. I can successfully use your plugin except when I enable secure cookies. This secure cookies is a requirement! IF so, how would I modify the plugin to allow for that? Can I use it without MVC callback? I means, I have asp. It is, however, feasible for an expert to crack these regular encryption methods. It runs very smoothly and quietly from the background of the Mac.

Taking a cue from that, if publishers may make their ebooks open to a larger audience instantly, it could and will encourage readers to go for that authentic version.

Excellent way of explaining, and good post to get facts concerning my presentation topic, which i am going to present in academy. I have tried with plugin with iPad. I imagine that Safari just opens the pdf instead of downloading it!. Are there some specific headers needed for this to work?

Well thanks, that is great. Problem arises only in IE where it does not see the cookie returned by B. It treats it as a third-party cookie or god knows what. Tried changing IE privacy settings to allow third-party cookies but it still does not work. This plugin looks very cool. I see from the download you are making it beginner friendly too. The one thing missing is a license statement. If you throw a license file in there it will make us corporate types more comfortable. It is not showing any prompt for the users to download the file.

Have anyone gotten this done in PHP or webforms? In IE8, when I tried to download by second time, the page was blank. My site is developed in asp. Can you help me? I am trying to use this functionality from a button on a modal dialog so that they can view a PDF form to confirm the data on the modal dialog. It refuses to open the file although I have it referencing a link on the same page the dialog reads itself from. Any ideas about this condition?

Sir this article is verry helpfull base on the article u wrote but Sir may i ask if u have version for visual studio our company is know developing using vs so i cant view the project.

I put the line: document. Oh my goodness! Incredible article dude! Is there anybody else having identical RSS problems? Anybody who knows the solution can you kindly respond? Thanks a lot for sharing this with all people you actually know what you are talking about! We could have a link trade contract between us. Spot on with this write-up, I actually think this website needs a great deal more attention. Did you hire out a developer to create your theme?

Fantastic work! Saved me a few hours doing it myself… Haha! Saved me a LOT of time and headaches! Hello and thank you for your plugin. What happens? Great plugin!!! Somebody had this before? In my case I am triggering the download of multiple large images.

Once the first one is done all the others will think they are done as well.. You can customize the name of the cookie to use for each instance if you would like. Could you please tell How we can set the responseHtml used in fail callabck from server, from where we are getting this value. Basically it just takes the error HTML from your response and stuffs it into the failCallback variable. Hi John, good job, I have this problem: I have to distinguish the session expired error from the other possible errors, in the first case the server sends back a status code, but from what I understood the only thing I can have in the failCallback is the html and not the http status codes, am I right?

If you do then call jquery file download. Is there a fix for this? I mean, a code fix, because changing the security options of Internet Explorer is not a possibility: I cannot tell all my users to do so….

Welcome to IE! Hey John, I have some trouble with your JS. I get the message from the IE Debugger, that a method or property with the name fileDownload not exists. I have these three References. Regards Michael. I am working on implementing this wondeful solution but am having a problem with the jquery Dialog creation.

It would appear that something is amiss with the jquery dialog but the Javascript files are being correctly referenced…. Thanks for the feedback. I have a feeling there might have been something else going on as well. Thanks for letting me know though! Hi John, You mentioned you will try to get the request headers done soon. Did you get a chance? Is it possible to add request headers to the download request or does everything have to be in the URL as query string parameters? Since this is basically driving an IFRAME, my suspicion is that it's not possible to augment the request in this manner, but it certainly doesn't hurt to ask!

Download processing is fine but after downloading the file dialog is not closing. I have read the comments and i have come to know the problem is that need to add setCookie method but where i have to place this bit of code. I will be greatly if help. Thank you in advance. Please suggest on what step I am wrong.

Thanks for the plugin. I have a problem retrieving files address with folder. For instance,. Thx — Kiko —. Hi, first of all thanx for this plugin, which is very useful indeed… I'm having though an issue when downloading a pdf on iPad in full screen mode. Doing a little research on google, it turns out that window. Great plugin! I do have a question though: I want to perform various other ajax operations while the download is in progress my downloaded file takes a while to create on the server.

On the server I keep track of how much progress the 'file building' has made. Great plugin this is amazing! I do have a question although I think I know the answer I thought I'd ask anyways. Is it possible to use the HttpResponseMessage and actually return a file that's in memory? The case I have is that I'm generating the file on the fly and trying to download it using your amazing plugin. Any help would be great! Thank you very much. I am trying to do the same thing as Jason.

Is there a way to download a file that exists only in memory? Thanks for the plugin! I'm able to get it working on all browsers. But in iOS, if popup is enabled, I can not get the new tab to load. Any way to bypass that? Great plugin, John! I had some problems getting successCallback to fire, but found the problem after a little while.

Hi John, First of all thank you for the wonderful script. Saved a lot of time in exporting the file to Microsoft Excel and download the same from the server. Though I could force download the file which was opening the file dialog, I was looking at an option where the download success message was displayed on the user screen.

You script help me do it. I did have a small glitch in the code. In your example for PHP you have set the cookie name to be 'fileDownload' and its value to 'true'. For some reason the condition where the cookies are checked for equality failed ver 1. Now the onSuccess call back got a hit.

But unfortunately, the cookie was being removed and this used to expire my session. I commented out the cookie removal code and its working fine.

I am yet to test further to see if there is any issues in commenting out the code in your script. Looking forward to your suggestions and any corrections to the approach I adopted. I implemented the code in vb. No error in show but it just does not download.

This plugin does not work if Content-Disposition: inline; is returned. Nothing happens. How to open pdf file in new tab using this? Using version 1. I searched on the internet and send you a diff file I don't have a github account, sorry for the following changes : add a name for iframe, target form to it. But its default size is unpractical. For browsers which prompt user, non-hidden frame border is visible, and it just blinks on file download, right before prompt displays.

Thank you for your feeback about this and the patch I propose. I'm having problems setting the cookie from a WebAPI controller. Anyone have an idea on how to accomplish this? Glad the plugin is working for you.

Perhaps I can include that in a future commit. Feel free to contribute on GitHub in the mean time if I don't get to it for awhile.

Anyway, short question. I checked the source code, but couldn't find anything. I would try stepping through the jQueryFileDownload source and see why the callback isn't getting called. I don't think it's an issue with the code since it appears to be working in the demo but you never know. If I were to throw a guess out there I would think that perhaps the cookie is being written incorrectly. I am having a few problems using the code from your "Custom rich user experience — jquery.

The modal dialog opens and the file download completes, but the dialog box does not close. It is not clear that the successCallBack function is ever called. The response header for the downloaded file has the appropriate settings for the cookie, as you describe in the documentation, so I'm not sure what might be broken. Also, the text "We are preparing your report, please wait…" never appears in the dialog.

This behavior is true for both Firefox I am having problems with getting the dialog to close. Files are successfully downloaded, but the dialog remains open after the download. I am using the code snippet from your "Custom rich user experience" that employs the 'preparing-file-modal' divs. The cookie is correctly returned in the response header, so I don't believe that is the problem.

Also, the text in the dialog "We are preparing your report, please wait…. This problem occurs in both Firefox Any clues on what I should be checking would be appreciated.

John, I managed after all. I can recognize empty download on server side, so I sent the same cookie but with different value. Then I copied your check of a cookie and callbacks and made emptyCallback available. Now I have success, empty download and error as three different paths with three different feedbacks for user.

Thank you again very much. I'm not aware of any way around it at this point unfortunately. Very interesting plugin and it works for me except for IE7.

Trouble in my case is, that the download may be empty, in which case failCallback is used. In IE7, however, this is not enough. But the question is — is there any other way how to treat empty download differently? What if real error occured on the server — then I can't distinguish it from empty response which I have to mask as I originally tried , which was probably deep misunderstanding on my part — this rather refreshed the whole page in the browser.

I'd welcome any suggestions as I'd love to use this plugin in our future works, it seems quite reliable when I stick to code for errors and the experience is just great. Users just can't be talked out of wanting to disable buttons and then enable them again, so we have to use something like this.

If I remove uncomment that line, everything loads fine. I have updated the GitHub and the demo site with a setTimeout 0 around the cleanup which should clear the stack before cleaning up hopefully fixing the issue.

I'm unable to get it to happen now. Anyone please let me know if you can get it to happen again, thanks! I confirm that for firefox there is problem. It'll fail silently and randomly even on demo for success case. If I DO add the SetCookie to the header, it may be 2 or 3 clicks before I see the dialog asking whether I want to open or save the file, but the file save dialog never appears after I click "Ok" on that one.

However, the callbacks don't get called until that dialog goes away, which is what I'd expect. I need to use this plugin with coldfusion 9. Here I found demo with ASP. I want to use this with coldfusion. No idea how to manage code related to cookie as shown for ASP. Any idea?! This is in response to Andrew Laws and anyone else experiencing intermittent failures to get prompted to save a file. The problem appears to be due to the iframe getting removed too quickly. I solved the problem by changing line of v1.

The added delay seems to clear up the problem. A better solution might be to check and see if the iframe already exist when it is being created and if so, remove the existing one first. If you are using. If you have httpOnlyCookies on you won't be able to read the cookie client side and it won't work. I think this might even be the default option. Example: A checklist sends a lot of params with the same name, so the server is waiting a list like object.

This tool is really useful. I have it working but it would seem that it doesn't work for ALL extensions of files. At least that's my conclusion after trying to download 5 files with the same name but different extensions.

Some were downloaded but to the others appeared the "A file downloaded error …" box and didn't download. And it's happening a funny thing in IE. When I request the download, the save box shows up but also the error box when downloading known extensions. Just wondering if anyone else has noticed an intermittent failure with this plugin when using Firefox? This is with a "straight" out of the box Firefox install v Chrome, Opera, Safari and, yes, even IE! There is absolutely no indication that anything has gone wrong apart form this.

When the failure occurs, it's not permanent, and clicking on the link again usually gets me the file but it still fails intermittently afterwards.

I've tried to figure out what's going on by installing the FireBug extension and debugging, but I can't track down the difference between the successes and failures. The flow of execution seems the same in both cases.

Having said that, I have noticed that:. For example, if my test file takes 5 seconds to prepare, and I set the checkInterval to i. Also, it could just be that I have been lucky and not seen it under those conditions — the usual problem with the intermittent problems….

Good idea on checking the iframe's readyState. Your right though, unfortunately when I was testing this approach Chrome didn't work. Each browser that did work had different things happen to the readyState of course right? Thanks for the thought! My successCallback is never called because if document. I can't help but think though, is the cookie component even necessary?

The iframe state can be tested using. I have used the same code that you have given but in simple ASP. Net , What should be the URL Passed in the link , I am giving the path of the pdf, But it is going to the Failure , what could be the reason, I will be really great full if you can help me on this. Plugin is unable to download 'dat' and 'jpg' files. I am not sure whats going wrong?

Your comments would be appreciated. There is a issue for Firefox, if my FF prompts me selecting the path to download, and at that time, the temp iframe has already been removed, so the download will not continue, anyway can detect the save as dialog? I took a look at the site indicated and it doesn't appear to be running anymore. The cookie should be written along with the response stream that contains the file. The cookie needs to be included in a header with that. Hopefully this helps!

Not sure if I've done this right. I have a gaming site and i'm trying to use your script to give the. I've included your modal dialog version of the script. What I'm not sure is about the server side cookie. I use a redirect script to track all the download requests in PHP.

Prior to setting the header location, I'm setting the cookie to your PHP line above. What happens on IE is that the download script reports a failure, but successfully executes the request.

On the Mac which is not really needed at this moment, but will be later it flashes the processing dialog and doesn't execute the download at all. I would have to write a proxy streaming script to know when its done since I'm linking outside my site. Not a big deal, but not something I saw noted in your example. I'm not sure what could cause that issue without doing local debugging of it. Make sure that you have added a script reference to jQuery before your script reference to jQuery file download.

Also try calling jQuery file download with the exact same syntax as mentioned in one of my posts to make sure its not a syntax issue for starters. Hope you get it figured out.

Are you writing a cookie along with your file download? Unfortunately this is the only way to detect file downloads reliably cross browser. Make sure using FireBug, Chrome, Fiddler etc. I hope this helps! Is never true, so it doesn't stop, and no success function is fired.

It happens on last versions of FF, Chrome and safary. Without it knowing any better it probably just spawns up a browser to deal with that event since IFRAMEs are generally junk except in this one case, ha! Unfortunately this is probably permanent so you may need to find a different solution perhaps using native code in the device you are targeting even?

First of all, great Plugin. Really usefull. I tried in my webbrowser, working properly. Does it work on webkit? I mean it does but actually I decided to include this into my phonegap app using jQuery Mobile and when i click the link it leaves the application and redirect to the native browser. Did I miss something? I have fully tested in native IE installs and everything appears to work properly in my demo. IE Tester is a pretty cool thing for high level testing I use it for starters on everything that I need cross IE browser support but sometimes it gets a little weird with things so I'll always finish off testing in a native install.



0コメント

  • 1000 / 1000