A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 25

Thread: MP3 player via anonymous FTP

  1. #1
    Junior Member
    Join Date
    Feb 2009
    Posts
    17

    MP3 player via anonymous FTP

    Hi Everyone,

    I'm trying to make an open site where anyone can post an MP3 file on my anonymous FTP and see / listen to it directly into the site (made with koolmoves 7).

    I need some help, is there a way in flash to have a file browser in order to import a local MP3 file right into my server (like a mini FTP client) and then have the file accessible automatically in the flash site ?

    I am a beginner so please give me some details about the procedure .fun files are welcome.

    Thanks in advance
    Cheers

  2. #2
    That web bloke Stoke Laurie's Avatar
    Join Date
    Jan 2006
    Location
    England
    Posts
    869
    You will have to overcome several issues here,
    1. The size of the mp3 file upload, this is often prohibitive for this type of project.
    2. Security, if you are granting access to your server for upload, you are opening yourself open to attack unlesss you are very careful.
    3. Missuse, you will not have instant control over the content on your site.
    4. Copyrite.
    Sorry to be negative, because the programming side of your problems present no great problems, but I think you should consider the above first.
    Some of the above can be overcome by including a moderation step into your plan, so content only goes live when you have had chance to review it.

  3. #3
    Junior Member
    Join Date
    Feb 2009
    Posts
    17
    Thanks for your quick response

    I have to make some precisions about the objectives of this website.
    This website is intended to be a contest website.
    This is a temporaly open web site (1 month only, contest duration)

    I am a sound teacher and I would like that several schools in my town to compete each other.

    This is how I would like it to work :

    Some people from the jury have access to a special area where they can post some raw sounds
    Students have access to this area in read only access
    They mix those raw sounds and post their creations into the site (and listen to each other would be nice).

    To answer :

    1. The size of the MP3 to post is limited in the contest to 80 sec (roughly 2Mo)
    2. I have a dedicated server whith a anonymous FTP size 240 Mo. Maybe you can tell me more about security.
    3. I can not be 100 % sure about the content but the communication of this contest is made in the schools, so I hope there will be no abuse. If there is a system for checking that the material uploaded is an MP3 file that is less than 80 sec it will be great.
    4. Copyrite is not an issue since I have copyrite for the raw sounds and all the sounds uploaded are fresh creations derived from them.

    Any help welcome

  4. #4
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    FTP should be possible by using sockets but that would be a bit complicated I suppose. The easiest way to upload a file is to post it to the server and use php on the server side to move the uploaded file to the right place.
    If you want to use real FTP, it might make more sense to let your users use a normal free FTP application like FileZilla.

    As for listening them online, a lot is possible but again using php on the server side is the easiest approach. The easiest way is to use a single playlist containing all mp3 files but more complex things are also possible to create.

    Here's an example of something I created some time ago using KM7 for personal use.
    Link removed
    Last edited by w.brants; 02-22-2009 at 04:55 PM.

  5. #5
    Junior Member
    Join Date
    Feb 2009
    Posts
    17
    Thanks w.brants,

    For the upload procedure I will communicate a special server login and the students will post their creations via FileZilla as you suggested. Is it possible to post sound files on the server and not to delete the other sound files ?

    For the php side I need some little help, your application seems to be what I am looking for. I am not a web developper is it possible to send me the files ?

    About php is it possible to make it work even if my website is hosted on ftp.blablabla.com and the sound files are hosted on ftp2.blablabla.com ?

    Could you please describe the directory structure on the server side (where to put the php file, how to make it communicate...) ?

    Thank you

  6. #6
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    I don't know if it's possible to prevent the removal of files if one has ftp access. In that case maybe uploading using Flash might be a better approach.

    As for the example I showed, I will add some documentation and post it to KoolExchange tomorrow so you (or others who want it) can download it from there.

  7. #7
    Junior Member
    Join Date
    Feb 2009
    Posts
    17
    Thank you so much !!!

    For the flash upload procedure I make an other post
    I keep contact for the integration of the php / Mp3 player

  8. #8
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    I uploaded the player to KoolExchange
    http://koolexchange.com/

  9. #9
    Junior Member
    Join Date
    Feb 2009
    Posts
    17
    I have just tried your application but I have no success to make it work so far...

    This is the directory structure I use on the server :



    If you could tell me where I'm wrong, thanks

  10. #10
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Try to view the playlist.php directly in your browser window to see if it outputs the playlist correct.

  11. #11
    That web bloke Stoke Laurie's Avatar
    Join Date
    Jan 2006
    Location
    England
    Posts
    869
    Hi wilbert I tried this, and hitting the php direct gives a fault on line 4

  12. #12
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    I used the php5 scandir function. You probably are using php4.
    I reworked the scandir.php file so it is php4 compatible now and replaced the package on KoolExchange. Please download the updated package from KoolExchange and try again.

  13. #13
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    If that is the case, you really need to migrate to PHP 5 as there a major security fixes in 5 as well as many improvements.

  14. #14
    Member
    Join Date
    Jul 2005
    Location
    Indiana, USA
    Posts
    79
    Works great Wilbert! http://www.michianaworldwide.com/KM/Audio/index.html

    At some point I intend to switch over to 5 too.
    The KoolMoves KoolExchange is one KoolPuppy.

    E-Z Websites

  15. #15
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Thanks for letting me know Phil.

  16. #16
    Junior Member
    Join Date
    Feb 2009
    Posts
    17
    Thanks a lot w.brants,

    It is working fine for me too.
    I will give you my website adress very soon...but I just want to know how to discard this code :

    I have put the Action script code (from the .fun file) in frame 4 of my website and when I move to frame 3 I still see the MP3 list (the left side of your application).
    Is there a way to discard it for frame 3 ?

    Thanks again

  17. #17
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    The Tree component used to display the MP3 list is not integrated in the KM GUI yet. Therefore it had to be created and added using actionscript. As a result of this it is not automatically removed when the frame changes.

    The best solution depends on how you build the .fun file. It is important that the Tree is only created once. If you navigate back and forth between frames, an extra check has to be built in. The easiest way if you have such a check is to create the Tree in frame 1 and use tree.visible = true; and tree.visible = false; to show and hide it when you want.

  18. #18
    Junior Member
    Join Date
    Feb 2009
    Posts
    17
    The tree.visible = true; and tree.visible = false; trick is working half time...

    My movie has 4 frames :

    the 1st calls all the objects for the intro page + the AS3 code and play
    the 2nd calls all the objects for the intro page and stop + hide the tree
    the 3rd calls other objects for contact and stop + hide tree
    the 4th calls the MP3 player and stop + tree visible

    There are buttons to navigate between 2 / 3 / 4

    It is working fine in koolmoves but when uploaded it freezes on frame 1 and when I jump directly to frame 4 the php code does not respond anymore.

    I think there is some priority behind this.

    Could you please describe an other procedure to discard the tree ?

  19. #19
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    It's strange that it freezes when put online but a bit hard to tell what's causing it without seeing the .fun file. The method you described should work.

    Instead of making an object visible, you can remove and add it again when needed. You do this with addChild and removeChild . What's important in this case is to check if it is still there before using removeChild because if you use removeChild on an object that has already been removed, it will generate an error.

  20. #20
    Junior Member
    Join Date
    Feb 2009
    Posts
    17
    I have not tried the other solution yet but I send you all the files (.fun + other files I need).

    http://www.megaupload.com/?d=A81ONBCJ

    Just tell me how it reacts with you.

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