min_width and min_height for the upload class? |
[eluser]teampoop[/eluser]
There are configuration parameters for the file upload library. Check out CI/user_guide/libraries/file_uploading.html for more details. Code: $config['upload_path'] = './uploads/';
[eluser]chefnelone[/eluser]
[quote author="teampoop" date="1291246123"]There are configuration parameters for the file upload library. Check out CI/user_guide/libraries/file_uploading.html for more details. Code: $config['upload_path'] = './uploads/'; I checked the user guide. But min_width and min_height are not include as parameter in the upload class. This http://ellislab.com/forums/viewthread/143418/#730179 shows a way to include these parameters... but it isn't working for me.
[eluser]teampoop[/eluser]
oh MIN... not MAX.. sorry I didn't read that right either..
[eluser]Dennis Rasmussen[/eluser]
12 replies and none of them of any value Lol InsiteFX haha (btw it's min- and max- in css and doesn't work in IE true). Anyway for chefnelone: What error are you getting when using the instructions in that post? Did you remember to add an error message as well?
[eluser]chefnelone[/eluser]
[quote author="Dennis Rasmussen" date="1291301868"]12 replies and none of them of any value Lol InsiteFX haha (btw it's min- and max- in css and doesn't work in IE true). Anyway for chefnelone: What error are you getting when using the instructions in that post? Did you remember to add an error message as well?[/quote] hi dennis. I get no error messages. It is just ignored. I'm using it to add a restriction when uploading image files. I need to the images to be bigger than: 800x600. But the restriction doesn't work since it uploads images smaller than those values.(without error messages) I carefully followed all the instructions but I can't get it working.
[eluser]Dennis Rasmussen[/eluser]
Show us your final code (library and controller)
[eluser]chefnelone[/eluser]
I attached: application/libraries/Upload.php I wrapped my changes with '//ADDED' (useful to make a search to spot modifications from original class) And here part of the method that fire the Upload class: Code: function upload_photos(){ I'm using firePhp, then I can get any data in the controller, just in case it helps...
[eluser]Dennis Rasmussen[/eluser]
Line 718 to 728 should start at 715 before "return FALSE". Notice where the $D array is set at line 704, but you're using it outside the scope. Let me know of the result
[eluser]chefnelone[/eluser]
[quote author="Dennis Rasmussen" date="1291310307"]Line 718 to 728 should start at 715 before "return FALSE". Notice where the $D array is set at line 704, but you're using it outside the scope. Let me know of the result [/quote] Thanks dennis! You hit the point! Works like a charm. I noticed that the message errors are the same for max_width and for min_width. Can I change this with some setting in the class or do I need to change the code? Anyway this is not any problem though...
[eluser]Dennis Rasmussen[/eluser]
Error message is displayed at line 250. It's unfortunately shared between min and max. You could do something like this: Code: if ($this->min_width > 0 AND $D['0'] < $this->min_width) Code: if ( ! $this->is_allowed_dimensions()) |
Welcome Guest, Not a member yet? Register Sign In |