I need a little help. Im a newbie. I’m trying to create a php script for uploading files. Currently I’m using a static/fixed location for uploading. But I want to organize them according to year/ month folders. just like wordpress. here is the code I’m using
$config['baseurl'] = 'http://mysite.com';
$config['path'] = $config['basedir'].'/uploads';
currently image path looks like: http://mysite.com/uploads/image.jpg
but I want: http://mysite.com/uploads/2012/07/image.jpg
I’ll very appreciate if someone make me a little php code. Thanks
You can append the date to the path like this:
You will need to also check that the path exists, and create it if it doesn’t.