"The upload path does not appear to be valid" (PULLING MY HAIR OUT !!!!) [SOLVED] |
[eluser]Christoph Rumpel[/eluser]
In my case it is not working with the period. It only works like that: $config['upload_path'] = '/Applications/MAMP/htdocs/gallery/'; $config['allowed_types'] = 'gif|jpg|png'; $config['max_size'] = '100'; $config['max_width'] = '1024'; $config['max_height'] = '768'; $this->upload->initialize($config); Still dont know why...
[eluser]Mohammad Rashidi[/eluser]
[quote author="crumpel" date="1304786762"]In my case it is not working with the period. It only works like that: $config['upload_path'] = '/Applications/MAMP/htdocs/gallery/'; $config['allowed_types'] = 'gif|jpg|png'; $config['max_size'] = '100'; $config['max_width'] = '1024'; $config['max_height'] = '768'; $this->upload->initialize($config); Still dont know why...[/quote] you just need to specify the upload pach, according to your CI root. Code: $config['upload_path'] = './gallery/'; whit this line of code, you mean that the images must be uploaded to a folder named "gallery" in your root, where you "index.php" is. pay attention for this lines after your above code: Code: $this->load->library('upload', $config);
[eluser]Christoph Rumpel[/eluser]
I tried $config['upload_path'] = './gallery/'; too. (gallery is my folder on MAMP/htdocs/ where alle my ci files are inside. I do not understand how path works in CI. I have a resize function with: $config['source_image'] = 'mypic.png'; and this is working. (http://localhost:8888/gallery/mypic.png) This would mean the root is inside ...gallery/ Still dont get why it does not work with the upload_path without "$this->upload->initialize($config);" Thx for the help
[eluser]Mohammad Rashidi[/eluser]
please let us now what are the errors via this line of code: Code: print_r($this->upload->display_errors()); your root is where your index.php is.
[eluser]Christoph Rumpel[/eluser]
Code: if ( ! $this->upload->do_upload()) This is how i implemented it. Result just: "The upload path does not appear to be valid." greets
[eluser]Mohammad Rashidi[/eluser]
it is part of my recent project: Code: $config['upload_path'] = './test/'; feel free to use these lines of code. please create a folder named 'test' in your CI root. also please ensure your field name & id is 'userfile'.
[eluser]Christoph Rumpel[/eluser]
Hi, thx Mohammad, but i solved it 2 hours ago and forget to submit my post :-) Here it is=) now it also works with the period and the folder. Dont ask me why. Additionally i am using this extension library for more options in resizing: MY Image lib Extension This is no how it works for me, maybe this code could be of use fore someone else. Code: function do_upload()
[eluser]Mohammad Rashidi[/eluser]
congratulate crumpel, i was trying to resize my images, but it does not! GD2 is enabled, i have WAMP. have you ever had any problem with resizing?
[eluser]Christoph Rumpel[/eluser]
I tried it today the first time, but it works for me. Do you get any errors? greets
|
Welcome Guest, Not a member yet? Register Sign In |