سؤال

My site will be viewed exclusively in Internet explorer 9

I have a small intranet site. On this site i want to allow my users to download files.

When they click the link they get the standard 3 options "Open, save, Save as..", but whenever the user clicks open, it allows them to edit directly in my file, instead of downloading a local copy, they can then edit.

Am i missing something crucial here? Is there any way i can have IE9 always download a local copy, before allowing editing?

I initiate the download with the following:

    function onDownload() {
        document.location = "../DUMP" + kunde + ".csv";
    }
هل كانت مفيدة؟

المحلول

Just replace

document.location = "../DUMP" + kunde + ".csv";

with

document.location = "http://yourhost/path/DUMP" + kunde + ".csv";

(you have to use http:// instead of file:// protocol to force downloading instead of opeining)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top