I'm trying to load an image into my applet from php. I'm reading in parameters into the applet for the image path. It will work if the url doesn't contain any spaces but if it does it won't work. I've tried url encoding the name of the file first and even encoding the complete url but doesn't work either. How do I handle this? I would like to handle it in php before app gets it.

Java Code:
<param name = "imageURL" value = "<?php echo urlencode($imagepath); ?>" />
Original html

URL encoded above but does not load
http%3A%2F%2Fwww.domain.com%2FUpload%2FGallery%2F1 %2FTest%2FDSCF1050+copy.jpg