Welcome Guest, Not a member yet? Register   Sign In
Processing an image before the form submits
#11

[eluser]Arjen van Bochoven[/eluser]
[quote author="NateL" date="1233700533"]
Now, I could probably trouble shoot this a little easier if i could output the data that addImage() is receiving. When I do a form submission, I usually do print_r($_POST) and that will display what is being received. that works...but since it's AJAX, I can't tell what is and isn't working.
[/quote]

Exactly. That was why I was suggesting to use log_message(), so you have a means to check serverside what is happening.

[quote author="NateL" date="1233700533"]
For log_message(), does that need to be in my addImage() ?
[/quote]

Yes, mind that it takes some effort to setup correctly, but for me it has proven a great help for debugging my apps.

Arjen
#12

[eluser]NateL[/eluser]
Thanks Ajren,

My logs folder is set up to 777 (read & write)

inside my controller: product.php
Code:
class Product extends Controller
{

  function addImage()
    {
      log_message('info', 'testing to see if addImage() executes');
    }
}

Ran that script, and nothing has appeared in my logs folder. Sad
#13

[eluser]Arjen van Bochoven[/eluser]
You also have to change

Code:
$config['log_threshold'] = 0;

in your config.php file to something else, I would suggest using 'debug' instead of 'info', because CI spawns a lot of info messages when initializing, filling up your log file rapidly.

grz

Arjen
#14

[eluser]NateL[/eluser]
$config['log_threshold'] = 1;

has been set to "1" since I started developing. I will research this and figure out what I'm doing wrong. thread is going the wrong way Smile

Thanks for your assistance Smile
#15

[eluser]cahva[/eluser]
Hi,

Install Firebug to see whats happening when you click the upload button. Firebug is a must if you use javascript and specially if you use ajax.
#16

[eluser]gon[/eluser]
While quite old-fashioned, the old hidden-iframe trick is still handy.

I only use it when uploading files or images the way you're doing, and it makes it quite simple to debug (just don't hide the iframe and you can see the error messages), and you don't depend on jQuery ajax uploading libs.

Good luck.
#17

[eluser]spmckee[/eluser]
Did you find the solution NateL? I am trying something similar.




Theme © iAndrew 2016 - Forum software by © MyBB