How to get file name?

#1
[eluser]Unknown[/eluser]
I follow user guide at http://ellislab.com/codeigniter/user-gui...ading.html to create my upload file application.

But I have a problem when I try to get the original file name.

Code:
.......
.......
.......
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size']    = '100';
$config['file_name']    = time().'_original_name'; // I tried = time().'_'.$_POST['userfile']; but it doesn't work
$config['max_width']  = '1024';
$config['max_height']  = '768';
......
......
......

Thanks for help

#2
[eluser]danmontgomery[/eluser]
You use $_FILES to access uploaded files, not $_POST

http://php.net/manual/en/reserved.variables.files.php

#3
[eluser]Unknown[/eluser]
:red: Achh.. Thanks noctrum

#4
[eluser]vitoco[/eluser]
also...you can't concatenate $_FILES['userfile'] to a string , cause $_FILES['userfile'] it's an array, get the appropriated index inside the array.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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