Welcome Guest, Not a member yet? Register   Sign In
The upload path does not appear to be valid -> WAMPServer2
#21

[eluser]codex[/eluser]
This is weird. When I set the upload values via $config I get errors, but when I set the same values directly in Upload.php it's all working. Any ideas?
#22

[eluser]Seppo[/eluser]
How are you using the $config array?
Can you post your code so we can try to reproduce it.
#23

[eluser]codex[/eluser]
[quote author="Seppo" date="1207706044"]How are you using the $config array?
Can you post your code so we can try to reproduce it.[/quote]

Code:
function _uploadPortfolioImage($portfolio_id)
    {
        # Set and load config for upload
        $config['upload_path']         = "./temp/";
        $config['allowed_types']     = 'jpg|jpeg|png';
        $config['max_size']        = '2000000';
        $config['overwrite']          = TRUE;
        $config['remove_spaces']      = FALSE;
        
        $this->load->library('upload', $config);

        # Attempt upload
        if (!$this->upload->do_upload('upload_file'))
        {
            # Display error
            $data['error'] = array('error' => $this->upload->display_errors('<p class="alert">', '</p>'));
            print_r($data['error']);
        }    
        else
        {
            # Upload the file
            $data = array('upload_data' => $this->upload->data());
        }
    }
#24

[eluser]Seppo[/eluser]
That works fine here (when temp is inside de CI folder, at the same level as the main index.php) running windows too.

Sorry I can't help
#25

[eluser]codex[/eluser]
[quote author="Seppo" date="1207721126"]That works fine here (when temp is inside de CI folder, at the same level as the main index.php) running windows too.

Sorry I can't help[/quote]

No probs, I appreciate the help :-)


Weird, this doesn't work:
Code:
$config['upload_path']       = './temp/';
$config['allowed_types']     = 'jpg|jpeg|png';
$config['max_size']          = 2000000;
$config['overwrite']         = TRUE;
$config['remove_spaces']     = TRUE;
        
$this->load->library('upload', $config);

while this does:
Code:
$config['upload_path']       = './temp/';
$config['allowed_types']     = 'jpg|jpeg|png';
$config['max_size']          = 2000000;
$config['overwrite']         = TRUE;
$config['remove_spaces']     = TRUE;
        
$this->load->library('upload', $config);
$this->upload->initialize($config);

It seems as if the config array isn't being set. Weird, but at least it works (kinda). Does someone have an idea as to why this happens?
#26

[eluser]Seppo[/eluser]
Well... the upload path is the first thing the do_upload method check, so it looks like all the config array is not passed to the validation class...
Are you extending the upload class?

Try adding this debug messages (and raising your log threshold to 2) to find out where the problem is....
system/libraries/Loader.php

Code:
//Line 90
log_message('debug', __CLASS__ . '::' . __FUNCTION__ . ' params: ' . print_r($params, true));

//Line 815
log_message('debug', __CLASS__ . '::' . __FUNCTION__ . ' params: ' . print_r($params, true));

//Line 862
log_message('debug', __CLASS__ . '::' . __FUNCTION__ . ' params: ' . print_r($config, true));
#27

[eluser]codex[/eluser]
I don't get it. I have used the exact same script on a live server and it has always worked fine. Could it be something like a Wamp setting that's screwing things up?

@ Seppo: I added the lines to loader.php, but there's nothing that indicates what could be wrong:

Code:
DEBUG - 2008-04-09 00:44:03 --&gt; Config Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; Hooks Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; URI Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; Router Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; Output Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; Input Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; Global POST and COOKIE data sanitized
DEBUG - 2008-04-09 00:44:03 --&gt; Language Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; Loader Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; Helpers loaded: modules_helper, url, img, formz, urlz, datetime, debug
DEBUG - 2008-04-09 00:44:03 --&gt; Controller Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; Config file loaded: config/cfg_site.php
DEBUG - 2008-04-09 00:44:03 --&gt; File loaded: application/modules/portfolio_module/controllers/portfolio_module.php
DEBUG - 2008-04-09 00:44:03 --&gt; Loader Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; portfolio_module module initialised
DEBUG - 2008-04-09 00:44:03 --&gt; Database Driver Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; File loaded: application/modules/portfolio_module/models/portfolio_model.php
DEBUG - 2008-04-09 00:44:03 --&gt; Model Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; ci_loader::_ci_load_class params:
DEBUG - 2008-04-09 00:44:03 --&gt; Validation Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; ci_loader::library params:
DEBUG - 2008-04-09 00:44:03 --&gt; Language file loaded: language/english/validation_lang.php
DEBUG - 2008-04-09 00:44:03 --&gt; ci_loader::_ci_load_class params:
DEBUG - 2008-04-09 00:44:03 --&gt; Upload Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; ci_loader::library params:
DEBUG - 2008-04-09 00:44:03 --&gt; Language file loaded: language/english/upload_lang.php
ERROR - 2008-04-09 00:44:03 --&gt; The upload path does not appear to be valid.
ERROR - 2008-04-09 00:44:03 --&gt; The upload path does not appear to be valid.
DEBUG - 2008-04-09 00:44:03 --&gt; File loaded: application/modules/portfolio_module/views/new_portfolio_item.php
DEBUG - 2008-04-09 00:44:03 --&gt; File loaded: application/views/portfolio_views/add_portfolio_item.php
DEBUG - 2008-04-09 00:44:03 --&gt; File loaded: application/modules/navigation_module/controllers/navigation_module.php
DEBUG - 2008-04-09 00:44:03 --&gt; Loader Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; navigation_module module initialised
DEBUG - 2008-04-09 00:44:03 --&gt; File loaded: application/modules/navigation_module/config/config.php
DEBUG - 2008-04-09 00:44:03 --&gt; File loaded: application/modules/navigation_module/helpers/navbar_helper.php
DEBUG - 2008-04-09 00:44:03 --&gt; File loaded: application/modules/navigation_module/views/main_navbar.php
DEBUG - 2008-04-09 00:44:03 --&gt; File loaded: application/views/layout_views/header_template.php
DEBUG - 2008-04-09 00:44:03 --&gt; File loaded: application/modules/navigation_module/views/footer_navbar.php
DEBUG - 2008-04-09 00:44:03 --&gt; File loaded: application/views/layout_views/main_template.php
DEBUG - 2008-04-09 00:44:03 --&gt; Final output sent to browser
DEBUG - 2008-04-09 00:44:03 --&gt; Total execution time: 0.3617
DEBUG - 2008-04-09 00:44:03 --&gt; Config Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; Hooks Class Initialized
DEBUG - 2008-04-09 00:44:03 --&gt; URI Class Initialized
ERROR - 2008-04-09 00:44:03 --&gt; 404 Page Not Found --&gt;
#28

[eluser]Seppo[/eluser]
[quote author="codex" date="1207730917"]@ Seppo: I added the lines to loader.php, but there's nothing that indicates what could be wrong:[/quote]
Well, there is... The load->library is not receiving the parameters for some reason...
Code:
DEBUG - 2008-04-09 00:44:03 --&gt; ci_loader::library params:
There the params are null...
So... how is it that we have
Code:
$this->load->library('upload', $config);

and the library method isn't getting a thing?
#29

[eluser]codex[/eluser]
[quote author="Seppo" date="1207764764"][quote author="codex" date="1207730917"]@ Seppo: I added the lines to loader.php, but there's nothing that indicates what could be wrong:[/quote]
Well, there is... The load->library is not receiving the parameters for some reason...
Code:
DEBUG - 2008-04-09 00:44:03 --&gt; ci_loader::library params:
There the params are null...
So... how is it that we have
Code:
$this->load->library('upload', $config);

and the library method isn't getting a thing?[/quote]

That's the exact same thing I am wondering. $config IS defined. 8-/
#30

[eluser]gunter[/eluser]
while this does:
Code:
---------
$this->load->library('upload', $config);
$this->upload->initialize($config);

It seems as if the config array isn't being set. Weird, but at least it works (kinda). Does someone have an idea as to why this happens?[/quote]

thats because you try to load the library and set the config array... but it seems that the library is already loaded - and if you try to load a library that is already loaded... then loader class stops and the new config arraay will not be set...
so, passing the $config array works only if the upload library isntĀ“t already loaded




Theme © iAndrew 2016 - Forum software by © MyBB