Welcome Guest, Not a member yet? Register   Sign In
Getting error when uploading file
#1

(This post was last modified: 04-07-2015, 05:56 AM by frocco.)

This was working when I had my upload directory in my app folder.
I now what to upload to the server folder called media/categories

The config below is showing:
The upload path does not appear to be valid.

Code:
$config['upload_path'] = '/media/categories/';

Thank you

[EDIT]
It works if I hard code the path:
'/lamp/www/media/store_categories'

How can I do this so it works when I deploy the app?
Reply
#2

Try it without leading slash.
Reply
#3

(This post was last modified: 04-07-2015, 08:56 AM by casa.)

if your directory architecture is like :
- system
- application :
  -- dir_upload
  -- application_name :
      --- config
      --- controller
      --- models
      --- helper
      --- view

If you want to upload files and record its in directory name 'dir1_upload', path will be 'dir_upload/'.
Use constants APPATH for other configuration or define it as well.
Think to check read/write attributes for your directory too (chmod).
Reply
#4

The code you posted shows /media/categories/, but you say it works when you hard code it to /lamp/www/media/store_categories (store_categories)

Try
FCPATH . 'media/store_categories';

FCPATH is the full path to your index.php file, which is in the root of your site. So the above should equate to /lamp/www/media/store_categories like you hardcoded it
Reply
#5

(04-07-2015, 09:23 AM)CroNiX Wrote: The code you posted shows /media/categories/, but you say it works when you hard code it to /lamp/www/media/store_categories (store_categories)

Try
FCPATH . 'media/store_categories';

FCPATH is the full path to your index.php file, which is in the root of your site. So the above should equate to /lamp/www/media/store_categories like you hardcoded it

Thank you, that resolved my issue. Smile
Reply




Theme © iAndrew 2016 - Forum software by © MyBB