SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: select xls file

  1. #1
    SitePoint Addict ankitaneja1's Avatar
    Join Date
    Sep 2004
    Location
    India
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    select xls file

    <HTML><BODY>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function saveme(){document.execCommand('SaveAs');}
    //-->
    </SCRIPT>
    <input type="button" value="Save As..."

    onclick="document.execCommand('SaveAs')">

    </BODY></HTML>

    this code gives option to select only .txt and html files
    i want to select xls file how can i do that
    Ankit Aneja
    "Nothing is impossible. The word itself says - I M possible"

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,189
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)

    save as

    .html and .txt files are both "plain text" files. I believe that .xls files are "binary".
    My guess is that execCommand('SaveAs') only works with "text" files. If you try it with .css or .xml does it work? Maybe there is something else that will let you save "binary" files, but I don't know what it might be.

  3. #3
    SitePoint Addict ankitaneja1's Avatar
    Join Date
    Sep 2004
    Location
    India
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thats what i am saying
    it doesn't work with .xml files
    i want the function by which i can do this
    Ankit Aneja
    "Nothing is impossible. The word itself says - I M possible"

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,189
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)

    vbscript

    I found this page that uses vbscript and an adodb stream to save a binary file. I think you should be able to use the same control to save an xls file as it streams the binary data. http://www.paulsadowski.com/WSH/getremotebinaryfile.htm


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •