• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
upload question

#2
[eluser]Twisted1919[/eluser]
Ain't gonna work like this .
First, you need to upload the file as it is, then, you get the properties of the uploaded file like
$props = $this->upload->data();
now, $props is an array, containing:
Code:
Array
(
    [file_name]    => mypic.jpg
    [file_type]    => image/jpeg
    [file_path]    => /path/to/your/upload/
    [full_path]    => /path/to/your/upload/jpg.jpg
    [raw_name]     => mypic
    [orig_name]    => mypic.jpg
    [client_name]  => mypic.jpg
    [file_ext]     => .jpg
    [file_size]    => 22.2
    [is_image]     => 1
    [image_width]  => 800
    [image_height] => 600
    [image_type]   => jpeg
    [image_size_str] => width="800" height="200"
)

Knowing that, you can use rename() to move rename your file to other name, but keep the extension .


Messages In This Thread
upload question - by El Forum - 12-13-2010, 06:30 AM
upload question - by El Forum - 12-13-2010, 07:26 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.