A Flash Developer Resource Site

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

Thread: anyone know why this is not working?

  1. #21
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    as a side issue, is there a way to check the size of the file? so I can stop a file being uploaded over say 100k? would that check be done in Flash or the php?

  2. #22
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    Can you get any error message back to me?
    What does happen with the code?

    Add this line at the beginning of the script:

    error_reporting(E_ALL);
    Altruism does not exist. Sustainability must be made profitable.

  3. #23
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    displayed this

    "Notice: Undefined index: Filedata in /home/website/public_html/game/uploadfile.php on line 17 Notice: Undefined index: Filedata in /home/website/public_html/game/uploadfile.php on line 23"

    but those are probably because I'm running the php file straight to display that msg, i.e no file was sent to it to be uploaded. Btw, when I ran it from the Flash, nothing happened, no file was uploaded.

  4. #24
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    You should pay more attention to the error reporting.
    That of PHP is a very useful debugging tool!

    In this case it's telling you that there is no element named "Filedata" in $_FILES.
    This is because you need to have an INPUT of TYPE="FILE" in the form of the page that calls the script. And that input must have a NAME="Filedata"

    Does this make things clearer?

    I know it's all a bit confusing, but it's quite simple...it's just a few things you need to learn by heart about how HTML forms work, and then how server-side script handle data.



    I'm going to bed, so any further reply will come no time before the next 8 hours.

    Cheers
    Altruism does not exist. Sustainability must be made profitable.

  5. #25
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    p.s.
    I would advise you to learn server-side scripting in form-based applications with HTML.
    Then once you've got close to it, pass onto the Flash interface.

    It's because the HTML way is very, very automated and standard, whereas in Flash it's all up to you.
    Altruism does not exist. Sustainability must be made profitable.

  6. #26
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    Quote Originally Posted by keyone.it
    You should pay more attention to the error reporting.
    That of PHP is a very useful debugging tool!

    In this case it's telling you that there is no element named "Filedata" in $_FILES.
    This is because you need to have an INPUT of TYPE="FILE" in the form of the page that calls the script. And that input must have a NAME="Filedata"

    Does this make things clearer?

    I know it's all a bit confusing, but it's quite simple...it's just a few things you need to learn by heart about how HTML forms work, and then how server-side script handle data.



    I'm going to bed, so any further reply will come no time before the next 8 hours.

    Cheers
    I did actually say that its probably giving those errors because i'm running the .php file straight, I wasn't calling it from the flash movie. The Flash movie does pass the correct variables to the .php file, but nothing happens! I know its passing the correct variables because it now works fine with the older (and now corrected) .php file.

  7. #27
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    Did you check if the file is actually overwritten.

    My script is "silent", meaning I did not put anything that will give a response.

    Based on how you designed your client-side (Flash or HTML), you must add something that will return data to the GUI.
    Altruism does not exist. Sustainability must be made profitable.

  8. #28
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    Hi,

    The Flash movie, uploads a file, and then hopefully the file that is there is deleted/overwritten. Its then downloaded to the flash movie for display (the uploaded image).

    I've tried with with various images, with the old code, and it seems to work fine now, although the code is messy.

    With the code example you gave, I couldn't get it to work (when working with the Flash movie) nothing happened, no file was uploaded, or overwritten.

  9. #29
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    Well if you want it to work with the new code, attach the files (FLA, PHP) and I will make it work then send them back to you.

    It's much easier to debug it like that..
    Altruism does not exist. Sustainability must be made profitable.

  10. #30
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    I appreciate the offer, but I think Ill just go with the older code for now. Thanks for the help though.

  11. #31
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    oh....one though, is there a way to limit the file upload size?

  12. #32
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    a-ight pal!

    call back if you need help
    Altruism does not exist. Sustainability must be made profitable.

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