Image Upload |
[eluser]MMCCQQ[/eluser]
hi im workin in a proyect with CI. i dont know how upload a image to a Folder. i need to know how create a Folder with CI ex: image/username/username.jpg image/MMCCQQ/MMCCQQ.jpg
[eluser]MMCCQQ[/eluser]
[quote author="walesmd" date="1187298203"]PHP.net: mkdir()[/quote] i know use mkdir but how can i integrate with CI?
[eluser]Derek Allard[/eluser]
consider the file helper. write_file('path', $data) Quote:Writes data to the file specified in the path. If the file does not exist the function will create it.
[eluser]MMCCQQ[/eluser]
<form action="register" method="POST" enctype="multipart/form-data" > <table> <tr> <td class="sti" >Your Avastar:</td> <td><input type="file" name="user_pic"/></td> </tr> </table> <input type="submit" id="button" value="Upload" /> </form> how i get user_pic file?
[eluser]MMCCQQ[/eluser]
i got this function Code: function Upload() create a folder with the id of the member. will work?
[eluser]MMCCQQ[/eluser]
dont work with this $config['upload_path'] = "/home/txxx/public_html/img/".$id; and work without ; $id but i need to know the id of img ex: /img/15/MMCCQQ_thumb.jpg Code: $config['upload_path'] = "/home/txxx/public_html/img/".$id;
[eluser]gunter[/eluser]
Code: _function Init_Directories($dir) I found an old function, I hope it works call it with: Code: $uploadPath ='this/is/the/path/that/will/be/created/image/username'; this this/is this/is/the... and so on
[eluser]MMCCQQ[/eluser]
how i add the "id"? i cant do this Code: = "/home/txxx/public_html/img/".$id; |
Welcome Guest, Not a member yet? Register Sign In |