It looks like you're new here. If you want to get involved, click one of these buttons!
<script type=\"text/javascript\" src=\"source/uploadify/jquery-1.3.2.min.js\"></script>
<script type=\"text/javascript\" src=\"source/uploadify/jquery.uploadify.js\"></script>
<script type=\"text/javascript\">
$(document).ready(function() {
$('#upload').fileUpload({
'uploader': 'source/uploadify/uploader.swf',
'script': 'source/uploadify/upload.php',
'checkScript' : 'source/uploadify/check.php',
'folder': 'source/banners',
'cancelImg': 'source/uploadify/cancel.png',
'multi' : true,
'auto' : true,
'buttonText' : 'DURCHSUCHEN',
'displayData' : 'percentage',
'onComplete' : function(event, queueID, fileObj, response, data) {
$('div#status').append(\"Datei hochgeladen: \" + fileObj.name + \" <br />\");
}
});
});
</script>
<input name=\"fileUpload\" id=\"upload\" type=\"file\" />
<body>
<h1>foo bar</h1>
<div id=\"uploadbox\">
<input name=\"fileUpload\" id=\"upload\" type=\"file\" />
</div>
<div id=\"status\"></div>
</body>
. TravisN. said:What is your HTML element code?
<html>
<head>
<title>Upload-Test</title>
<script type=\"text/javascript\" src=\"source/uploadify/jquery-1.3.2.min.js\"></script>
<script type=\"text/javascript\" src=\"source/uploadify/jquery.uploadify.js\"></script>
<script type=\"text/javascript\">
$(document).ready(function() {
$('#upload').fileUpload({
'uploader': 'source/uploadify/uploader.swf',
'script': 'source/uploadify/upload.php',
'checkScript' : 'source/uploadify/check.php',
'folder': 'source/banners',
'cancelImg': 'source/uploadify/cancel.png',
'multi' : true,
'auto' : true,
'buttonText' : 'DURCHSUCHEN',
'displayData' : 'percentage',
'onComplete' : function(event, queueID, fileObj, response, data) {
$('div#status').append(\"Datei hochgeladen: \" + fileObj.name + \" <br />\");
},
onError: function (a, b, c, d) {
if (d.status == 404)
alert('Could not find upload script. Use a path relative to: '+'<?= getcwd() ?>');
else if (d.type === \"HTTP\")
alert('error '+d.type+\": \"+d.status);
else if (d.type ===\"File Size\")
alert(c.name+' '+d.type+' Limit: '+Math.round(d.sizeLimit/1024)+'KB');
else
alert('error '+d.type+\": \"+d.text);
}
});
});
</script>
<style>
body {
font: 12px/18px Arial, Helvetica, sans-serif;
}
.fileUploadQueueItem {
font: 11px Verdana, Geneva, sans-serif;
background-color: #F5F5F5;
border: 3px solid #E5E5E5;
margin-top: 5px;
padding: 10px;
width: 300px;
}
.fileUploadQueueItem .cancel {
float: right;
}
.fileUploadProgress {
background-color: #FFFFFF;
border-top: 1px solid #808080;
border-left: 1px solid #808080;
border-right: 1px solid #C5C5C5;
border-bottom: 1px solid #C5C5C5;
margin-top: 10px;
width: 100%;
}
.fileUploadProgressBar {
background-color: #0099FF;
}
</style>
</head>
<body>
<h1>foo bar</h1>
<div id=\"uploadbox\">
<input name=\"fileUpload\" id=\"upload\" type=\"file\" />
</div>
<div id=\"status\"></div>
</body>
</html>
TravisN. said:If you download the "Uploadify Sample Collection" from the downloads section, and run the second sample down do you still get the error?
TravisN. said:hmmm. It is looking like server settings. I copied your folder setup to my server and all ticked over without a problem.
Let's have a look at
1. what OS is your sever
2. is your server local
3. what are your php.ini settings - can you upload it so I can compare
4. you said that if you remove the checkScript option it runs perfectly. But have the files actually uploaded?
mine yours
max_input_time -1 60 -maximum time post and get scripts can send data (-1 = unlimited)
memory_limit 124M 40M -should be greater than post_max_size
and this, but I don't think this would have any effect. Worth a try though
register_argc_argv On Off -Used for sending GET values across scripts
json_encode
seminole75 said:Chances are your server is running PHP 4 - the check.php script uses afunction which is only included natively in PHP 5 - I had this problem as well. To solve this solution, you can either upgrade your PHP version or you can download a JSON.php file compatible with PHP 4 and include it in check.php before the encode call. Hope this helps.json_encode
Matt
<?php
if (!function_exists('json_encode'))
{
function json_encode($a=false)
{
if (is_null($a)) return 'null';
if ($a === false) return 'false';
if ($a === true) return 'true';
if (is_scalar($a))
{
if (is_float($a))
{
// Always use \".\" for floats.
return floatval(str_replace(\",\", \".\", strval($a)));
}
if (is_string($a))
{
static $jsonReplaces = array(array(\"\\\", \"/\", \"\n\", \"\t\", \"\r\", \"\b\", \"\f\", '\"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\\"'));
return '\"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '\"';
}
else
return $a;
}
$isList = true;
for ($i = 0, reset($a); $i < count($a); $i++, next($a))
{
if (key($a) !== $i)
{
$isList = false;
break;
}
}
$result = array();
if ($isList)
{
foreach ($a as $v) $result[] = json_encode($v);
return '[' . join(',', $result) . ']';
}
else
{
foreach ($a as $k => $v) $result[] = json_encode($k).':'.json_encode($v);
return '{' . join(',', $result) . '}';
}
}
}
?>