⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Uploads files giving error "An error has occurred on uploading."



brunohauck

brunohauck
  • profile picture
  • Member

Posted 12 July 2012 - 13:13 PM

Uploads files giving error "An error has occurred on uploading."

noskov.biz

noskov.biz
  • profile picture
  • Member

Posted 12 July 2012 - 15:38 PM

Hi, brunohauck!
Check your upload folder permitions. If you work with your local machine just set permitions to 0777.

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 12 July 2012 - 20:00 PM

[member='brunohauck'] You have to check your firebug and tell me what error occurs there.

brunohauck

brunohauck
  • profile picture
  • Member

Posted 13 July 2012 - 11:52 AM

No error is occurring on firebug and web developer. This is a returning message from the system and I already set the permition to 777. I created a code igniter upload script and it is working.

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 14 July 2012 - 19:57 PM

I am sorry I cannot reproduce the error. It can be anything. Can you please tell me if this works at your local machine? Even if you don't have an error can you please have the response of your firebug when you are uploading the file? (For example: [attachment=223:firebug-test.png] ) ?

Also perhaps this post will help you with your problem: /topic/473-file-upload-issue/page__p__1939

brunohauck

brunohauck
  • profile picture
  • Member

Posted 16 July 2012 - 10:28 AM

This is the error that firebug is giving back.

<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>A PHP Error was encountered</h4>

<p>Severity: Warning</p>
<p>Message: Cannot modify header information - headers already sent by (output started at /hermes/bosweb/web103/b1036/ipg.idsgeocom/softwareon/dev/assets/grocery_crud/languages/pt-br.portuguese.php:1)</p>
<p>Filename: libraries/grocery_crud.php</p>
<p>Line Number: 4369</p>

</div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>A PHP Error was encountered</h4>

<p>Severity: Warning</p>
<p>Message: Cannot modify header information - headers already sent by (output started at /hermes/bosweb/web103/b1036/ipg.idsgeocom/softwareon/dev/assets/grocery_crud/languages/pt-br.portuguese.php:1)</p>
<p>Filename: libraries/grocery_crud.php</p>
<p>Line Number: 4379</p>

</div>{"success":true,"files":[{"name":"9a339-epc_wall-3.jpg","size":276259,"type":"image\/jpeg","url":"http:\/\/www.softwareon.com.br\/dev\/uploads_imagens\/9a339-epc_wall-3.jpg"}]}

fdias

fdias
  • profile picture
  • Member

Posted 16 July 2012 - 11:40 AM

#brunohauck try removing all spaces before "<?php" and after "?>"

Let me know if it works!

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 17 July 2012 - 06:42 AM

Also make sure that you have the grocery CRUD at your controller and not in your view. For example :


public function my_function_name()
{
$crud = new grocery_CRUD();

$crud->set_table('your_table_name');
$output = $crud->render();

$this->_example_output($output);
}


and NOT straight away to the view like this:


...
<header>....</header>
<div><?php echo $crud->render(); ?></div>
...

brunohauck

brunohauck
  • profile picture
  • Member

Posted 19 July 2012 - 15:18 PM

I checked if is the script has space in "<?php" and after "?>".
And changed the codification to utf-8 without BOM
I doing the calling of the grocery crud in the controller like Johnny sad.

And still no working.

So I have to comment all lines that have -> header(....);

//header('Pragma: no-cache');
//header('Cache-Control: private, no-cache');
//header('Content-Disposition: inline; filename="files.json"');
//header('X-Content-Type-Options: nosniff');
//header('Access-Control-Allow-Origin: *');
//header('Access-Control-Allow-Methods: OPTIONS, HEAD, GET, POST, PUT, DELETE');
//header('Access-Control-Allow-Headers: X-File-Name, X-File-Type, X-File-Size');

And right now is working. And I want to know why the grocery crud have to change the header information and why is no working. I will try it on local host using xampp maybe is an apache error our a php version.

I have to thank for the all help and I hope to solve the problem sun.

fdias

fdias
  • profile picture
  • Member

Posted 20 July 2012 - 16:48 PM

You are welcome.

Little tip if you are on windows use WAMP as I had many problems with XAMPP.

Cheers.

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 21 July 2012 - 22:03 PM

Totally agree with [member='fdias'] is much better to use wamp if you are on windows :) .

brunohauck

brunohauck
  • profile picture
  • Member

Posted 10 October 2012 - 17:58 PM

Please a Need Help Again !!!

I need help again for this topic o solved the problem commenting the header information and it was working but right now it stopped to work again and it is showing just 1 as the return and is not uploading. I checked again the permission on the folder and it is 777.
Maybe is something on the php.ini file but I don’t know what it tis.

brunohauck

brunohauck
  • profile picture
  • Member

Posted 11 October 2012 - 02:00 AM

This is the return of firebug is giving

{"success":false,"message":1}

No error.

I update the version of the grocery to see if the error stop but still giving the same message.

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 14 October 2012 - 15:14 PM

This will help you a lot: /topic/263-just-a-heads-up-for-uploading/

brunohauck

brunohauck
  • profile picture
  • Member

Posted 15 October 2012 - 16:57 PM

I changed the php.ini file to uploads larger files.

I will try to but grocery crud in my local host and see if it works and than compare the php.ini files with the server version.

brunohauck

brunohauck
  • profile picture
  • Member

Posted 19 January 2013 - 20:04 PM

[color=#282828][font=helvetica, arial, sans-serif]I reset the php.ini file and right now it is working.[/font][/color]