I’m trying to upload files to server using Uploadify script and then show them using PHP on the website, in the form of “www.example.com/directory-of-upload/file.mp3”.
It works fine, until i upload files that contain characters such as commas,quotes etc. Then the php code breaks.
For instance, when i try to parse the file URL as a parameter in a flash player, it looks like this:
<param name="flashvars" value="soundFile=http://localhost/public_html/content/plugins/post_audio/uploadify-local/uploads/song,+one.dad'a;-A.b!@.mp3&titles=song,+one.dad'a;-A.b!@&playerID=audioplayer_song,+one.dad'a;-A.b!@">
and the file doesn’t play. I guess it has something to do with these characters (commas,quotes..)
How should i fix this issue? Is reg ex the only solution?
Thanks in advance.
1 Answer