#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    1
    Rep Power
    0

    Saving file to PC


    Greetings all,
    I am new to Python and I have created a web page where the user fills out information in a form and then press submit and it gets passed to a phython script that returns the output back to the web browser. The output is just a large amount of text. What I would really like to be able to do is have the user fill out the information on the form and when they press submit, I would like them to see the output in the browser but also have the option to save it as a text file to their local pc. I know they can just save from the browser and do a save as .txt file but trying to find out if there is a better way to do the same thing programatically

    thanks
    Wally
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Location
    39N 104.28W
    Posts
    157
    Rep Power
    2
    Originally Posted by wfsteady
    Greetings all,
    I am new to Python and I have created a web page where the user fills out information in a form and then press submit and it gets passed to a phython script that returns the output back to the web browser. The output is just a large amount of text. What I would really like to be able to do is have the user fill out the information on the form and when they press submit, I would like them to see the output in the browser but also have the option to save it as a text file to their local pc. I know they can just save from the browser and do a save as .txt file but trying to find out if there is a better way to do the same thing programatically

    thanks
    Wally
    Browser code is limited by design from writing (except cookies) to the client platform. The generally accepted way to do what you want is on the server-side. However, depending on the size of the data you want to write, you might be able to use the cookie approach.

IMN logo majestic logo threadwatch logo seochat tools logo