Upload image on wordpress (Netsons)

i’m doing a wordpress system with images upload, i have tryed to do the upload with this code:

if ( ! function_exists( 'wp_handle_upload' ) )
                            require_once( ABSPATH . 'wp-admin/includes/file.php' );
                        $uploadedfile = $_FILES['file'];
                        $upload_overrides = array( 'test_form' => false );
                        $movefile = wp_handle_upload( $uploadedfile, $upload_overrides );

taken by codex official page, but i have this problem:

Read More

File is valid, and was successfully uploaded[“error”]=> string(212) “File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.”

I have searched a lot, and i have to say that i couldn’t try to modify the php parameters because my hosting (netsons) doesn’t give me the possibility.

Thanks

Related posts

Leave a Reply