Downloading an Excel File

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thanawala27
    New Member
    • Mar 2007
    • 68

    Downloading an Excel File

    Hi.

    I want to download an Excel file from the server and am using the following code.

    Code:
    <input type=button value="Click To Download" onClick="location.href='Logs.xls'">
    On clicking this button, I get the following Error.

    exec of /tmp_mnt/org/www/cgidir/dev_cgitools/Codeplug/Logs.xls failed (Exec format error)

    I read about Exec Formet Error, and found that Excel seems to be an invalid format. I have no clue why the excel file is not working for this particular operation because, it works fine while uploading data in the same excel file.

    Any help is appreciated.


    Thanks,

    Ravi
  • clain
    New Member
    • Feb 2007
    • 79

    #2
    is the excel file in the same location where the page is??? else give the correct path... also check if JavaScript is enabled..

    Comment

    • AricC
      Recognized Expert Top Contributor
      • Oct 2006
      • 1885

      #3
      If you want to download the Excel file why are you trying opening it in the same window? Why wouldn't you just use an anchor to create a link to the page? I tried your example on my local machine and it worked fine for me.

      Comment

      Working...