I'm having problem with image upload, i'm using parse as backend and everything is working, but i realize if filename is with space like "this is img.jpg" the uploader is not working, this is actual code
if (isset($_FILES['image']['name'])) {
if (strlen($_FILES['image']['name'])>3) {
$image = ParseFile::createFromData( file_get_contents( $_FILES['image']['tmp_name'] ), $_FILES['image']['name'] );
$content->set("image", $image);
@unlink($_FILES['image']['tmp_name']);
}
}
i tried to use str_replace but still is not working, i get blank page, i think im doin something wrong
if (isset($_FILES['image']['name'])) {
if (strlen($_FILES['image']['name'])>3) {
$image = ParseFile::createFromData( file_get_contents( $_FILES['image']['tmp_name'] ), $_FILES['image']['name'] );
$img = str_replace(' ', '_', $image);
$content->set("image", $img);
@unlink($_FILES['image']['tmp_name']);
}
}