Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jul 2010
    Location
    Sheffield
    Posts
    822
    Thanks
    93
    Thanked 18 Times in 18 Posts

    Save iFrame content to server

    I have an iFrame on my page which I'm going to use FPDF in to generate PDF pages.

    I want to save the PDF file to the server. Is this something Javascript could do? Or will I need a different approach?

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,733
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    No. You must user server-side scripting.

    JavaScript running in the browser does not have any commands for reading or writing files. JavaScript is a client-side language; modern browsers can read files on the server using an Ajax call, but otherwise JavaScript has no capability to read from, write to or delete a file (except a cookie), or communicate with the server.

    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    Regular Coder
    Join Date
    Jul 2010
    Location
    Sheffield
    Posts
    822
    Thanks
    93
    Thanked 18 Times in 18 Posts
    Could I maybe do it from the page in the iFrame itself then?

    EDIT: Serves me right for not reading, FPDF can save to server automatically, I don't need to write my own method.
    Last edited by tomharto; 07-10-2013 at 11:13 AM.


  •  

    Posting Permissions

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