<p>Please use library MGS_file_upload instead of default class provided by Codeigniter frameworks.</p><p><br></p><p>How the library works :</p><p>By default, the library will try to upload documents to private directory specifies by programmers.If the directory not yet created, it will create the directory and set htaccess to deny from all request.If programmers require user to upload documents to public path, please call method/function <span style="color: rgb(221, 187, 136);">set_directory_public() </span>to change uploading configuration.The library will gives an error if the directory access is not the same as the uploading configuration.</p><p><br></p><p>Reason for using this library:</p><ol><li>to avoid programmer uploading sensitive document to public path</li></ol><p><br></p><p>Example of usage :</p><p>$upload_status&nbsp;<span style="color: rgb(34, 85, 136);">=</span>&nbsp;$this<span style="color: rgb(34, 85, 136);">-&gt;</span>mgs_file_upload</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: rgb(34, 85, 136);">-&gt;</span><span style="color: rgb(221, 187, 136);">set_file_type</span>(<span style="color: rgb(242, 128, 208);">FILE_TYPE_IMAGE</span>)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: rgb(34, 85, 136);">-&gt;</span><span style="color: rgb(221, 187, 136);">set_upload_directory</span>(<span style="color: rgb(34, 170, 68);">'assets/'</span><span style="color: rgb(34, 85, 136);">.</span>$upload_directory)</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: rgb(34, 85, 136);">-&gt;</span><span style="color: rgb(221, 187, 136);">uploads</span>(<span style="color: rgb(34, 170, 68);">'logo'</span>);</p>