echo name file?

See all posts See thread Reply

Re: echo name file? new!
by colin, 12 years, 7 months ago
You can use file_dst_name after calling Process(). It is all in the docs.Reply
Re: echo name file? new!
by Bobrinha, 12 years, 7 months ago
I'm using this code

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;
 
}
}

Name in DB insert is uploadsslide.jpg , uploadsslide_1.jpg etc...

Correct is insert em DB slide.jpg , slide_1.jpg etc

Help-me plizReply
Re: echo name file? new!
by colin, 12 years, 7 months ago
According to the docs:

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_nameReply
Re: echo name file? new!
by Bobrinha, 12 years, 7 months ago
Tanks my friend, I'm noob :(Reply