Problem with Gallery Image Uploading |
[eluser]jshultz[/eluser]
I've got an image uploader that doesn't upload images. I'm not receiving any errors and i've checked the folder permissions and even on 777 no images are getting uploaded. You can see the code here: http://pastebin.com/Wzu4gyed The value for gallery_path is /home/domain/public_html/assets/images/gallery The value for gallery_path_url is http://domain.com/assets/images/gallery/ I have used this same code on another site with zero problems. I'm not sure what the problem is with this site? Here's the message I'm getting from var_dump: Quote:The upload path does not appear to be valid. You did not select a file to upload. array(13) { ["file_name"]=> string(0) "" ["file_type"]=> string(0) "" ["file_path"]=> string(0) "" ["full_path"]=> string(0) "" ["raw_name"]=> string(0) "" ["orig_name"]=> string(0) "" ["file_ext"]=> string(0) "" ["file_size"]=> string(0) "" ["is_image"]=> bool(false) ["image_width"]=> string(0) "" ["image_height"]=> string(0) "" ["image_type"]=> string(0) "" ["image_size_str"]=> string(0) "" } string(48) "/home/verdebus/public_html/assets/images/gallery" I checked the file extensions and they're correct. i've tried hardcoding the upload path, removing /home/verdebus from it and just using /public/html/assets/images/gallery and that didn't work. and i've tried it with and without a trailing slash. still no go.
[eluser]nzmike[/eluser]
Make sure all the directories in the path can be read/executed by whatever user runs your web server.
[eluser]jshultz[/eluser]
i double checked that. The funny thing is that I am using the same code in another site and have had no problem. it's really perplexing me.
[eluser]nzmike[/eluser]
I'm not sure if this is the problem but in your view you have: Code: form_upload('); Which creates a file input with the name "userfile". Later on you go onto do: Code: if(! $this->upload->do_upload(')){ Which will always be true if I'm not mistaken because "Filedata" will not be set. I doubt this will fix it. The only other thing I can recommend is try simplifying your code a bit. Get rid of everything that isn't to do with uploading an image i.e. the resize you do at the end. I've only briefly looked at the code but hopefully this will help you find your bug.
[eluser]jshultz[/eluser]
I removed the extra code, still no go. ![]() [quote author="nzmike" date="1279687706"]I'm not sure if this is the problem but in your view you have: Code: form_upload('); Which creates a file input with the name "userfile". Later on you go onto do: Code: if(! $this->upload->do_upload(')){ Which will always be true if I'm not mistaken because "Filedata" will not be set. I doubt this will fix it. The only other thing I can recommend is try simplifying your code a bit. Get rid of everything that isn't to do with uploading an image i.e. the resize you do at the end. I've only briefly looked at the code but hopefully this will help you find your bug.[/quote]
[eluser]jshultz[/eluser]
[quote author="crusher machine" date="1279867917"]Make sure all the directories in the path can be read/executed by whatever user runs your web server. cone crusher[/quote] That's been done, too. It's the same server as I'm using for other websites. I'm using the same code on another site on the server to do the same thing without any problems. That's why this has been such a perplexing situation.
[eluser]jshultz[/eluser]
Ok, I've cleaned up the code to the point that I'm basically copying the user guide. Here's what I have: Here's the Upload Function: Code: function do_upload() { Here's the view: Code: <div class="span-24"> I'm not even messing with a model. When I upload a file, it's still not going into the folder. I've tried different ways for formatting the path. I've made sure that the folder is 777. Here's the errors that I'm getting back: array(1) { ["error"]=> string(102) " The upload path does not appear to be valid. The upload path does not appear to be valid. " } array(13) { ["file_name"]=> string(0) "" ["file_type"]=> string(0) "" ["file_path"]=> string(0) "" ["full_path"]=> string(0) "" ["raw_name"]=> string(0) "" ["orig_name"]=> string(0) "" ["file_ext"]=> string(0) "" ["file_size"]=> string(0) "" ["is_image"]=> bool(false) ["image_width"]=> string(0) "" ["image_height"]=> string(0) "" ["image_type"]=> string(0) "" ["image_size_str"]=> string(0) "" } Any ideas?
[eluser]jshultz[/eluser]
Ok, I'm still fighting with this. I've worked on the controller some more, trying to do some troubleshooting. Here's the new rewrote controller: Code: <?php And the View: Code: <div class="span-24"> Just to clarify about the paths. If you FTP to the server, this is what the path to the upload directory look like: /public_html/uploads gallery_path is: /home/verdebus/public_html/uploads and gallery_path_url is http://vvbusinessresource.com/uploads/ i've tried various ways of hardcoding the path into the variable but I consistently get "The upload path does not appear to be valid." in the error. I have three other sites on the server where uploading files has not been a problem. I just don't know why I'm having a problem this time. ![]() |
Welcome Guest, Not a member yet? Register Sign In |