Somebody know how to call Save as dialog box ?

Discussion in 'PHP' started by cesarwj, Feb 6, 2012.

  1. #1
    Hi,


    Somebody know how to call Save as dialog box ?


    I want the system ask the user the path to download the CSV file.


    How to works my code: The user fill the form, click on submit and I work with the data from POST to create a CSV file. then, after it, I want to show AUTOMATICALLY the Save as dialog box to ask him the path (from your PC) to download.


    I tryed with javascript, but after create the CSV the user needs to click on Save as button.


    I tryed with Header, but I think that its doens´t work because before Header I have code that works with the POST.


    I have a code that in the final save the CSV file to user machine, but don´t know how to ask him.


    Somebody know how can I do it?


    tks
     
    cesarwj, Feb 6, 2012 IP
  2. awood969

    awood969 Member

    Messages:
    186
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    40
    #2
    I think this is probably for security concerns, else there would be nothing to stop me automatically downloading a virus on the computer.

    However you can use JS to set a download in motion. From there it would bring up the open/save box, it is of course up to the user what they do with that.

    Thanks
    Andrew
     
    awood969, Feb 9, 2012 IP
  3. cesarwj

    cesarwj Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Tks by information...


    then I think that I resolve the problem with iframe. I send the data to this and after insert it into CSV file in PC.

    I have a problem: Why some servers the iframe work and other not? In the some server the txt from fiel go to iframe, but don´t appear the download dialog. Do u know why?

    It´s not a problem with browser, because in my machine it´s works, but not in server.

    tks
     
    cesarwj, Feb 9, 2012 IP