help with file upload |
[eluser]dadamssg[/eluser]
I did have an event submission form with no file upload but now i want to have the option to upload a picture. Couple questions about this. What is the "field name"? How do i make the upload validation NOT run if they have chosen not to upload anything? The user guide uses an example with only uploading a file and using the do_upload function. I'm not seeing how i call that function if something was chosen to be uploaded.
[eluser]Colin Williams[/eluser]
The name attribute of the input tag Code: <input type="file" name="userfile" /> Check files array Code: if (isset($_FILES) and count($_FILES))
[eluser]dadamssg[/eluser]
thanks, is there a way to check to see if the upload is valid without actually uploading it?
[eluser]Colin Williams[/eluser]
PHP.net has all this covered, if you're at all interested http://us2.php.net/manual/en/features.fi...method.php
[eluser]dadamssg[/eluser]
well yeah i know how to do it without codeigniters file upload class...was wondering if you could do it WITH the help of CI.
[eluser]Colin Williams[/eluser]
That page shows a way to validate a file upload, functionality that doesn't exist in CI.
[eluser]flaky[/eluser]
Here in the userguide you have the File Upload Class read it http://ellislab.com/codeigniter/user-gui...ading.html
[eluser]dadamssg[/eluser]
is there a way to use set_value for a file upload?
[eluser]Colin Williams[/eluser]
You clearly have little understanding of how file uploading works on the web. What good would set_value do you with a file input?
[eluser]maria clara[/eluser]
hi, i have here my file upload script for image. you can edit it for helpful tips in your CI. CONTROLLER: Code: function index() MODEL: Code: function SaveForm($file_name) VIEW: Code: <?php echo $error;?> |
Welcome Guest, Not a member yet? Register Sign In |