Welcome, Guest
  • Author Topic: Saving Data as Text - Local  (Read 2822 times)

    James S. Daniel

    • Server what's that
    • *
    • Posts: 2
    • You want it when?
      • View Profile
      • Email
    Saving Data as Text - Local
    « on: 11/08/07, 11:47 »
    Hi, I'm a newbie to flash & PHP and I need to get flash to save data to a text file.  The Saving Data as Text tutorial is great but heres my problem..  The Flash program will not be runing deleaing with a sever.  I will need to install and run PHP on a system that is not a server.  My question is this is it possible to do this and if so how?  I've installed PHP on a windows & macs and I don't see the Saving Data as Text example working at all so something must not be set up correctly.  Please Help.

    ----------------------------
    I can get the Saving Data as Text on my server but I get the following errors when the PHP file is run

    Warning: fopen(anastasio.txt) [function.fopen]: failed to open stream: Permission denied in /home/hsphere/local/home/lindanie/danieldesigns.com/test/Flash/save.php on line 9

    Warning: fwrite(): supplied argument is not a valid stream resource in /home/hsphere/local/home/lindanie/danieldesigns.com/test/Flash/save.php on line 10
    writing=Error
    Warning: fclose(): supplied argument is not a valid stream resource in /home/hsphere/local/home/lindanie/danieldesigns.com/test/Flash/save.php on line 12

    I'm assuming that these are caused by my server not letting the PHP script to write to the disc.
    « Last Edit: 11/08/07, 13:04 by James S. Daniel »
    James Daniel
    Daniel Designs

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re: Saving Data as Text - Local
    « Reply #1 on: 11/08/07, 15:33 »
    the error says, you have no rights writing into this file.
    Change the access rights for this file - here are tons of posts about this issue.

    To write data, you allways need some middleware. Flash itself cannot write to the file system (sandbox security).
    happy flashing
    8)
    Ronald

    James S. Daniel

    • Server what's that
    • *
    • Posts: 2
    • You want it when?
      • View Profile
      • Email
    Re: Saving Data as Text - Local
    « Reply #2 on: 11/08/07, 15:58 »
    Thanks for the confermation on the couse of the error when writing to the server.  I get that I need middleware, I'm just having a problem getting PHP to run locally.  I'm starting to think that using some other middleware than PHP.  Does Flash support Java?
    James Daniel
    Daniel Designs

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re: Saving Data as Text - Local
    « Reply #3 on: 11/08/07, 17:56 »
    do the loading and savin tutorials - there you learn how flash communicates - it basicly is the exchange of strings.

    I personaly realised some projects, which were meant local, with the local installation of apache (XAMPP).

    This runs perfect, and as side effect, you can easyly move it later into a server environment with multiuser access.
    happy flashing
    8)
    Ronald

    Musicman

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 2685
      • View Profile
      • Email
    Re: Saving Data as Text - Local
    « Reply #4 on: 11/10/07, 01:16 »
    Hi,

    on unix servers the recommended procedure would be to create a text file (anastasio.txt) manually, then change its permissions so that "anybody" can write the file: I would assume windows procedure to be somehat similar

    Musicman