File Upload Problem - What have I missed? |
[eluser]ownersbox[/eluser]
I have read a ton of threads on this subject and tried everything they suggest, so far nothing has worked. I get "The upload path does not appear to be valid." I have an uploads directory set to 777. I have tried the directory relative and static... Code: var_dump($_SERVER['SCRIPT_FILENAME']); I am using the same page with the uploads added as the SCRIPTS_FILENAME. The is directory check returns true. So it sees the directory, the directory is writtable but still I get the error. Here is my upload code in the controller Code: var_dump($_SERVER['SCRIPT_FILENAME']); Thoughts? I am on MT if that helps.
[eluser]Yorick Peterse[/eluser]
Try the following upload path: Code: $config['upload_path'] = './uploads/'; This will upload the files to the 'uploads' directory if you structure is as following: Code: public_html (the root)
[eluser]ownersbox[/eluser]
Sorry, that was the first path I tried. I just tried it again and the dir check say true, so it does see it but I still get the "The upload path does not appear to be valid." Do I need to do something special to my routes or htaccess?
[eluser]outrage[/eluser]
Depends on your htaccess. Some htaccess files prevent access to folders/files with a line similar to this: Code: RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico) Try adding your uploads folder to this line like so: Code: RewriteCond $1 !^(index\.php|uploads|images|css|js|robots\.txt|favicon\.ico) Good luck.
[eluser]ownersbox[/eluser]
I'm still getting the error but I'm not sure I have my htaccess correct Code: <IfModule mod_rewrite.c>
[eluser]ownersbox[/eluser]
Anyone have any thoughts on this? I have tried the three options here: http://codeigniter.com/wiki/Dreamhost_.htaccess/
[eluser]Unknown[/eluser]
Hello, Can anyone help me to resolve my issue. I tried one sample code to upload images. But I am getting following error. "You don't have permission to access /CodeIgniter/index.php/upload/do_upload on this server." I have given all required permissions. Eventhough I am getting same error. Please help me to resolve this issue. Since I am new to this frame work. Thanks in advance.
[eluser]KieranA[/eluser]
[quote author="outrage" date="1243537923"]Depends on your htaccess. Some htaccess files prevent access to folders/files with a line similar to this: Code: RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico) Try adding your uploads folder to this line like so: Code: RewriteCond $1 !^(index\.php|uploads|images|css|js|robots\.txt|favicon\.ico) Good luck.[/quote] fyi .htaccess doesn't effect the server locally, php ignores it - it's only when you access it through the http protocol that it kicks in.
[eluser]ownersbox[/eluser]
I solved my problem - While the error I was getting was invalid path it actually was an issue with conflicting validation. Once I reverted to the original upload example it worked fine. Thank you for your help. |
Welcome Guest, Not a member yet? Register Sign In |