uploading on subfolders

Hi guys,
I'm new here and here's my dull question:

Running CI on my localhost using XAMPP and I'm trying to upload images on a 'uploads' folder but in subfolders (ie. each user has it's own subfolder of uploaded images and thumbs).

$id = $this->session->userdata('id');
$config['upload_path'] = 'uploads/'.$id.'/';

But when I run this, I get a: The upload path does not appear to be valid.
How should I do it?

Hi and welcome.

First of all be sure the path exists with is_dir() of file_exists(). If not, create it. If it gets created somewhere you don't expect it, your path is wrong.

Assuming the upload dir is in your root, use APPATH.'uploads/'.$id.'/'; for both checking and uploading.

Also, make sure the webserver is allowed to create and write the dir.

how to create and delete a file directory?

to create a directory use

to delete a directory use

hope this helps

tnx it help..
but what if i want to delete a folder that has a file in it? it gives me a validation error..

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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