Uploading Class do_upload() works intermittently |
[eluser]Shaun Andrews[/eluser]
Hi All, I'm working on a way to allow image uploads, but it only seems to work intermittently; sometimes files upload fine, sometimes they don't. When I select a file and submit, my browser will show its doing "something" but nothing happens and it eventually "timesout." However, if I go back and try again it works the second time. I've found another post that discusses this: http://ellislab.com/forums/viewthread/96387/ The solution in the above post seemed to be related to the local development environment. I am working locally, running Apache and PHP5 on OS X. Here's my full controller method: Code: function create($project_id) { // Create a new page. Here's the pertinent information related to the file upload: Code: $config['upload_path'] = './_uploads/'; As you can see above, I'm just starting out with this, and have simply told CI to upload the file to a folder, and if there's any errors to die and show those errors. My view looks like this: Code: <fieldset class="page_image"> Any help would be greatly appreciated.
[eluser]bretticus[/eluser]
My initial advise would be to check your PHP upload settings... ...and make sure that you'r not uploading images that are too big (intermittently.)
[eluser]Shaun Andrews[/eluser]
Thanks for the response. I'm not uploading large images; the file I was testing with is only 45k. But, to be clear, the file _will_ upload on the second try. It seems that every _odd_ upload works fine, while every _even_ upload timesout.
[eluser]Out of Control[/eluser]
You mentioned OS X. Are you using Safari to test the uploads? I have seen this exact behaviour with Safari on both local and production development. If you are using Safari, try Firefox and see if you get the same response.
[eluser]Shaun Andrews[/eluser]
How strange. Firefox seems to work just fine. Guess I'll ignore the issue for now in Safari. I'll report back if I find a cause/solution for this issue. If anyone know what's going on here in Safari, I'd love to hear from you.
[eluser]Crimp[/eluser]
Can confirm this behavior in Safari. Sometimes it simply "hangs". Don't know why. |
Welcome Guest, Not a member yet? Register Sign In |