I don't get a any error, nothing. No, the files not in directory of uploads. $_Files is empty.
But i missed the 'enctype' => 'multipart/form-data' in elgg_view_form, so i solved this problem.
$resized = get_resized_image_from_uploaded_file('image_upload', 120, 120, false, true);
if($resized){
$filehandler = new ElggFile();
$filehandler->owner_guid = $guid_classified;
$filehandler->setFilename("classified/" . $guid_classified . "-classified.jpg");
$filehandler->open("write");
$filehandler->write($resized);
$filehandler->close();
}
@Marcelo de Andrade, what is the main purpose for your custom 120px by 120px image form? Is it to allow your users to place ads or advertise on your site?
Yes, @Tom. I created a space for ads in my elgg site and the users can upload a image
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.