I am stuck in the download part. I am using uploadify script. Regular files load successfully, but when I get tired of loading the file name using file's.jpg , an HTTP 500 error occurs. My add script:
<script type="text/javascript">
$(document).ready(function() {
$('#attachment').uploadify({
'uploader' : '<?php echo base_url();?>web/uploadify/uploadify.swf',
'script' : '<?php echo base_url();?>web/uploadify/uploadify.php',
'cancelImg' : '<?php echo base_url();?>web/uploadify/cancel.png',
'folder' : '/admin_panel_new/assets/plupload/uploads/',
'auto' : true,
'multi' : true,
'hideButton': false,
'buttonImg' : "<?php echo base_url()?>images/attachment_image.gif",
'width' : 132,
'height' : 25,
'removeCompleted' : false,
'onSelect' : function(file) {
$('#submitFeedback').val('Please wait while uploading...');
$('#submitFeedback').attr('disabled','disabled');
},
'onComplete' : function(event, ID, fileObj, response, data) {
if($('#fileList').val()!='')
$('#fileList').val($('#fileList').val()+','+response);
else
$('#fileList').val(response);
$('#submitFeedback').removeAttr('disabled');
$('#submitFeedback').val('Post Feedback');
},
'onError' : function(event, queueID, fileObj, errorObj) { alert(errorObj.type + ' ' + errorObj.info ); }
});
});
</script>
I tried many other solutions, but no luck.
My uploadify.php code:
<?php
$targetFolder = $_POST['targetFolder'];
$unik =$_POST['timestamp'];
$verifyToken = md5('unique_salt' . $_POST['timestamp']);
if (!empty($_FILES) && $_POST['token'] == $verifyToken) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;
$targetFile = rtrim($targetPath,'/') . '/'.$unik.'_'.$_FILES['Filedata']['name'];
$fileTypes = array('jpg','jpeg','gif','png','txt');
$fileParts = pathinfo($_FILES['Filedata']['name']);
if (in_array($fileParts['extension'],$fileTypes)) {
move_uploaded_file($tempFile,$targetFile);
echo $unik.'_'.$_FILES['Filedata']['name'];
} else {
echo 'Invalid file type. Upload Failed';
}
}
?>
Images of loading errors look like this:

If anyone has a solution, please help. Thank.