How to debug browser hang during upload

mastgupshup

New Member
I am writing a simple file uploader in CodeIgniter 2.0.2. Pasting code below.Under certain conditions the browser hangs during this upload and I get "waiting for localhost" in the browser status bar (identical behavior in FF and Chrome).I have verified that the file is being uploaded to the Windows temporary folder (the complete file), but the process gets stuck after that.It appears that the condition for the bug is file size. But my php.ini has all the right settings for uploading files, and I still get the hang with a 700k file.This bug occurs only when I run it on Windows 7 Apache, not on an Ubuntu box.The suggested to me that some paths in the php.ini may be incorrectly set.Apache log files have not been much help here because there is no error thrown.I have tried using Chrome developer panel to debug but haven't turned up anything useful.I am currently trying to get XDebug working, but since no error is thrown and the process doesn't complete, my expectations are low. Any suggestions for how to trace this bug?If there are specific php.ini settings you'd like to see, let me know, don't want to do the big dump.Controller:\[code\]function do_upload_sql(){ // create directory if (! is_dir(BACKUP_DIR)) { mkdir(BACKUP_DIR, 0777); } // or if it exists and has restricted file permissions, change them elseif(fileperms(BACKUP_DIR)!=0777){ chmod(BACKUP_DIR, 0777); } $config['upload_path'] = BACKUP_DIR; $config['allowed_types'] = 'backup'; // an SQL backup file type $config['overwrite'] = TRUE; $this->load->library('upload', $config); if ( ! $this->upload->do_upload()) // this is the native CI function, probably where the problem is. I can provide some of that code if anyone wants. { $data['action'] = 'c_backup_restore/do_upload_sql'; $tab_error = array('error' => $this->upload->display_errors()); $data['error'] = $tab_error['error']; $this->load->view('common/header'); $this->load->view('v_upload_sql', $data); } else { echo "success"; // yes it's getting here, but i get no file! $data = http://stackoverflow.com/questions/10542086/array('upload_data' => $this->upload->data()); $file_upload = $data["upload_data"]; $this->restore_backup($file_upload); // go do something useful with the file }}\[/code\]View:\[code\]<p>Select the backup file</p><div class="not_success"><?php echo $error;?></div><?php echo form_open_multipart($action);?><input type="file" name="userfile" size="30" /><input type="submit" value="http://stackoverflow.com/questions/10542086/Upload" /></form>\[/code\]
 
Back
Top