CodeIgniter Forums
i can`t upload file to server - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: i can`t upload file to server (/thread-11602.html)



i can`t upload file to server - El Forum - 09-15-2008

[eluser]minhbu[/eluser]
hey
I am writing a module. When i used class upload which can`t upload file to server. In order to i used move_upload_file() that it process success.
Help
Message Error is the path is not valiable


i can`t upload file to server - El Forum - 09-16-2008

[eluser]LuckyFella73[/eluser]
Did you set the right permissions for the upload folder?
Should be set to 777.
Maybe the directory is not writable. Hard to say whats wrong
with your script. Some code of your application would be
usefull to help you.

Did you read the user guide section (file uploading class):
http://ellislab.com/codeigniter/user-guide/libraries/file_uploading.html


i can`t upload file to server - El Forum - 09-24-2008

[eluser]minhbu[/eluser]
no, i am using windows xp.
But i use move_upload_file is successful. But i don`t know why ?


i can`t upload file to server - El Forum - 09-24-2008

[eluser]LuckyFella73[/eluser]
It's impossible to help you without having a look at the
script responsible for uploading the file and maybe the
directories you dit set up at your root (or where ever) to
load the files in.

Quote:When i used class upload which can`t upload file to server.

I would recommend to read the CI user guide and follow the
instructions step by step, because the
upload class IS definitely able to upload files!
Don't give up too early! It wouldn't make much sense to
use a framework like codeigniter if you don't want use the
provided libraries (of course you still can).


i can`t upload file to server - El Forum - 09-24-2008

[eluser]minhbu[/eluser]
this is my code.
Quote:$path='./uploads/';
if(!is_dir($path))
mkdir($path);
$config['upload_path'] = $path;
$config['allowed_types'] = 'gif|jpg|png|bmp';
$config['max_size'] = '10000';
$config['max_width'] = '1024';
$config['max_height'] = '768';

$this->load->library('upload', $config);
if(!$this->upload->do_upload())
echo $this->upload->display_errors();
My link http://localhost/code/index.php/upload/
my root C:\AppServ\www\code
In dir Code directory
i created uploads directory
But this code displayed errors
The upload path does not appear to be valid.
I don`t know why ?
Please help me !


i can`t upload file to server - El Forum - 09-24-2008

[eluser]jbads[/eluser]
Delete the /uploads/ folder. Run the script again, then see whether it is creating that folder or not. If not, that is your first problem.