function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
akschampakschamp 

How to detect file download complete on VF page

Hi..

 

I've a requirement of providing download functionality from Vf page. I'me finished with downloading functionality but once user clicks on download button and complete with file download then need to do somes updates in custom object, so is there ay way where I can detect that file download is complete (IE, chrome and mozilla browser)? 

PremanathPremanath

When you clcik on Down load Button in vf page.

It will call Apex class methods / construcor Right?

So from there you need to call future class.

in that future class you need write those operations whatever you need...

Hope this is helpful for u.

 

Prem

akschampakschamp

Hi Prem,

 

Thanks for your reply. 

 

Actually here is the flow of scenario:

 

1. VF page with 'Download' button
2. This download button Refers to a VF page which I've rendered as Text file.
3. So once user clicks on this download button, the referred VF page will be downloaded as Text file and some count gets incremented on Custon object.
4. This works well in chrome as Chrome browser does not have file download dialog, but when it comes to IE or Mozilla, When user clicks on 'download' button, it opens IE/Mozilla browser dialog with buttons, Open, Save and Cancel
5. So when user clicks on Open and save button it will work fine and count should increment on Object but if user clicks on Cancel button then count should not be increased and this is where it fails.

 

akschampakschamp
Please let me know if any way to get this 'Cancel' button event from IE or Mozilla to avoid updates or is there any other approach.
PremanathPremanath

Sorry i don't think soo about browsers