Welcome Guest, Not a member yet? Register   Sign In
File Upload Class: Change file name
#11

[eluser]xwero[/eluser]
or change the file_name upload class setting.
#12

[eluser]metamorpher[/eluser]
already tried, and is useless...

don't know if I should download CI core again... does it got already fixed?
#13

[eluser]xwero[/eluser]
i think it's added to the 1.7.1 version otherwise it's still in SVN
#14

[eluser]metamorpher[/eluser]
still having the same issue with the 1.7.1

Code:
$configuracion['upload_path']    = $this->config->item('gallery_upload_path');
        $configuracion['allowed_types']    = 'gif|jpg|png';
        $configuracion['max_size']        = '1500';
        $configuracion['overwrite']        = FALSE;
        $configuracion['file_name']        = "whatever";
        $this->load->library('upload',$configuracion);
#15

[eluser]metamorpher[/eluser]
one more question for the go...

I got overwrite on FALSE. Why it uploads the file and rename assigning it a number??? How can I get the error message??? I'm using display_error, but well, for that the do_upload has to return false, right... What am I missing?
#16

[eluser]Unknown[/eluser]
i have answer.


$name = $_FILES['userfile']['name']; // get file name from form
$fileNameParts = explode( ".", $name ); // explode file name to two part
$fileExtension = end( $fileNameParts ); // give extension
$fileExtension = strtolower( $fileExtension ); // convert to lower case
$encripted_pic_name = md5($name).".".$fileExtension; // new file name
$config['file_name'] = $encripted_pic_name; //set file name

thanks.. Big Grin
mashuri.web.id




Theme © iAndrew 2016 - Forum software by © MyBB