"The upload path does not appear to be valid" - Aaaargh |
[eluser]invision[/eluser]
On my own server I can upload files correctly to my uploads directory on the root. But not on this new server (FastHosts). I've tried the basic here: http://ellislab.com/codeigniter/user-gui...ading.html and I can't seem to upload a file. Each time I try I get : The upload path does not appear to be valid. I'm using this as my: Code: $config['upload_path'] = 'uploads/'; Code: var_dump(is_dir('uploads/')); it returns true, so does definitely exist. Please help. I've no idea what to try now
[eluser]WanWizard[/eluser]
After the line that produces this error, add: Code: echo $this->upload->upload_path; The validate_upload_path() method of the Upload library converts relative paths to absolute paths. It might be that it is converted to another path than you think...
[eluser]invision[/eluser]
Thanks for the reply. When I add that, I don't get anything in response. Is that odd? excerpt... Code: if ( ! $this->upload->do_upload())
[eluser]WanWizard[/eluser]
Change it to Code: echo "[",$this->upload->upload_path,"]";
[eluser]invision[/eluser]
Hi again. The output is now: [] So does that mean it is empty? This is my full Upload controller: Code: <?php
[eluser]WanWizard[/eluser]
Weird indeed. With that $config the library loads without problems here. A call to $this->upload->validate_upload_path() returns FALSE (my dev system doesn't have a directory upload), but the value of upload_path is unaltered. If I replace upload_path by a single dot (current dir, which is always valid), after a call to validate_upload_path() it is changed to the docroot (the directory with the index.php file). Is your upload directory a sub directory in the root?
[eluser]invision[/eluser]
The upload directory is in the root itself: Code: /application/
[eluser]WanWizard[/eluser]
Do you have PHP errors enabled? If not, check your webserver log for any error messages. Something else might be wrong.
[eluser]invision[/eluser]
I've got my webserver log displaying errors, but none are relating to this. I've spoke to the host, hope to hear back soon. Failing that, we'll have to look elsewhere. I will let you know how it goes. Thank you for your help
[eluser]vitoco[/eluser]
try to get the full path.. Code: echo '['.realpath( $config['upload_path'] ).']'; if you get '[]', try to use APPPATH to create you upload_path. |
Welcome Guest, Not a member yet? Register Sign In |