Skip to main content
Jush1
Known Participant
June 27, 2012
Answered

Can you write an excel file on client machine instead of on the server

  • June 27, 2012
  • 2 replies
  • 937 views

I am trying to user cfSpreadSheet functon. The first question I have is, can you write the file on a client machine? I tried but they all end up on the server drive. Scecond question, is there a way to do row and column range formating in CF9.0? SpreadsheetFormatCellRange function is only available for ColdFusion server version 9.01.

Thanks.

    This topic has been closed for replies.
    Correct answer Dan_Bracuk

    You can't directly write to the client machine.  However, using cfcontent you can invite the user to either open or save the file.

    2 replies

    Inspiring
    June 27, 2012

    To expand on Dan's answer: CF doesn't have any interaction with the client browser at all: client->server comms are handled by the client and the web server; the web server simply asks CF to provide the response data if the file requested is a CF file.  But even then all CF does is process the requested file and return data to the web server.

    Also, one of the restrictions of the HTTP protocol is that that there is *no* *way* that the server can write to the client machine.  All it can do is send data to the client agent (eg: a web browser) in response to the client agent requesting it.  Can you imagine the sort of security problems one would open one's self up to if a remote web server could write to your PC????

    --

    Adam

    Jush1
    Jush1Author
    Known Participant
    June 28, 2012

    Thanks Adam, I guess I worded wrong, I meant to give user option so they can either open or save on client machine, Basically invoke the directory dialog box, so the drive can be available for user to save. But this is accomplished by doing Dan's suggestion. Appreciate your helpful insights.

    Dan_BracukCorrect answer
    Inspiring
    June 27, 2012

    You can't directly write to the client machine.  However, using cfcontent you can invite the user to either open or save the file.

    Jush1
    Jush1Author
    Known Participant
    June 27, 2012

    Thanks for the reply Dan, that's helpful.