class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
more info about the class
See all posts Reply
include('conexao.php'); include('class.upload.php'); $handle = new upload($_FILES['my_field']); if ($handle->uploaded) { $handle->file_new_name_body = 'slide'; $handle->image_resize = true; $handle->image_x = 666; $handle->image_y = 260; $handle->process('uploads'); if ($handle->processed) { echo 'Slide cadastrado com sucesso...'; $query = mysql_query (" INSERT INTO slide(imagem,titulo,texto,preco) VALUES ('".$handle->file_dst_pathname."','$titulo','$texto','$preco')"); $handle->clean(); } else { echo 'error : ' . $handle->error; } }
I wonder how I see the image name renamed after upada on screen?
Name in DB insert is uploadsslide.jpg , uploadsslide_1.jpg etc...
Correct is insert em DB slide.jpg , slide_1.jpg etc
Help-me pliz
file_dst_path : Destination file path
file_dst_name_body : Destination file name body
file_dst_name_ext : Destination file extension
file_dst_name : Destination file name
file_dst_pathname : Destination file complete path and name
In your case, you can use file_dst_name