dcsimg
A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 30 of 30

Thread: How to make a save.php

  1. #21
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    What did you exactly do, since it works for me. I just tested it again. You can also replace the image on the server in the script

    http://flashscript.biz/flashas3/save.../testimage.jpg

    with an image url for an image on your desktop, then press save button and then check the image. If you get that message, which you got, then the file was not written.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  2. #22
    Member
    Join Date
    Dec 2010
    Posts
    36
    My script which i pasted on the previous page also comes with so many (hundreds) actionscripts. Therefore i wouldnt really wanna mess with only one of them. I made the php file the way your adress showwed (except naming it save.php) and i got that error file.

    If somebody just take a look at my code for 2 minutes and tell me what is wrong exactly, im sure we can solve this problem very quick.

  3. #23
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    1. Did you test this on a server?
    2. The URLRequestHeader arguments are important.
    var header:URLRequestHeader = new URLRequestHeader("Content-type","application/octet-stream");
    3. You need to use an image encoder, preferably the one from Adobe, which works well.

    I recommend you to make your script much simpler. The php file works very well with the SaveByteArray class, which I recommend to use instead. The document class, which you saw above the php script is an example how to call and use the SaveByteArray class.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  4. #24
    Member
    Join Date
    Dec 2010
    Posts
    36
    Well my friend. I am not good with flash coding. I am making changes on the actionscript. I cant write nor create one. I am just editing. So since im not good with flash script can you tell me where am i gonna add codes exactly?

    I have tested the php file on my server yes. But like i said i didint make any changes on the actionscript.

  5. #25
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    I can only give you limited help. So in your script, which you showed above change this line:
    loc3 = new flash.net.URLRequestHeader("Content-type", "application/x-www-form-urlencoded");

    to

    loc3 = new flash.net.URLRequestHeader("Content-type","application/octet-stream");

    Then instead of
    flash.net.navigateToURL(loc4, "_self");
    replace with:

    var loader:URLLoader = new URLLoader ;
    loader.dataFormat = URLLoaderDataFormat.VARIABLES;
    loader.load (loc4);

    Try that and see what you get. Don't forget to import any new classes.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  6. #26
    Member
    Join Date
    Dec 2010
    Posts
    36
    I used the php file you told me in the link you sent...
    Same result
    myResult=Could not place the file

  7. #27
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Did you make all the changes in the script as I pointed out above? I thought you were already using the php script, which I linked to.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  8. #28
    Member
    Join Date
    Dec 2010
    Posts
    36
    I did. Then i recompiled the swf and got this error.

  9. #29
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Another possibility is that your url is not correct:
    p.rooturl + "/save.php?name=" + arg2 + "&type=" + arg1

    The name has to be the name of the image plus the extension (for example image.jpg). What is type? That is not recognized by the php script as a variable. The only other variable recognized is "folder" to create a folder.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  10. #30
    Member
    Join Date
    Dec 2010
    Posts
    36
    I dont determine the name. I choose the file from the computer and edit it. So file name changes everytime i edit a picture.
    I can edit any picture file. So the type changes also.

    The save.php file is in he same folder with index.html and swf file. There are no other files anyway.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center