Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing Uploadify with CodeIgniter
    text
    copied!<p>I'm having trouble implementing the uploadify in CodeIgniter. The when i click to upload the selected file, the process bar runs successfully, however the file is not uploaded. I think the script never reads the upload.php file located in the upload folder.</p> <p>Here is my code:</p> <pre><code>&lt;script type="text/javascript" src="&lt;?php echo base_url(); ?&gt;js/jquery-1.3.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="&lt;?php echo base_url(); ?&gt;js/jquery.uploadify.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $("#fileUpload").fileUpload({ 'uploader': '&lt;?php echo base_url(); ?&gt;uploadify/uploader.swf', 'cancelImg': '&lt;?php echo base_url(); ?&gt;uploadify/cancel.png', 'script': '&lt;?php echo base_url(); ?&gt;uploadify/upload.php', 'folder': 'upload/files', 'multi': false, 'displayData': 'speed', }); }); &lt;/script&gt; </code></pre> <p>Please note the above folder path. The files structure is following:</p> <pre><code>upload/application //codeigniter application folder upload/system //codeigniter system folder upload/uploadify //uploadify folder upload/files //where i want to move uploaded files. </code></pre> <p>I have tried this also:</p> <pre><code>'folder': '&lt;?php echo base_url(); ?&gt;/files', </code></pre> <p>Here is my upload.php file(upload/uploadify/upload.php" content</p> <pre><code>&lt;?php if (!empty($_FILES)) { $tempFile = $_FILES['Filedata']['tmp_name']; $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/'; $targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name']; move_uploaded_file($tempFile,$targetFile); } echo '1'; ?&gt; </code></pre> <p>My second question is that is it possible that instead of using the above upload.php file, i can use the function in the controller? If yes, how that can be done?</p> <p>Please help me to fix this problem.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload