It looks like you're new here. If you want to get involved, click one of these buttons!
<form>
<div id="queue"></div>
<input id="file_upload" name="file_upload" type="file" multiple="true"/>
<a id="uploadbutton" style="position: relative; top: 8px;" href="">Upload Files</a>
</form>
<script type="text/javascript">
if (Modernizr.webworkers) {
$(function () {
$('#file_upload').uploadifive({
'uploadScript': 'uploader.php',
'auto': false,
'formData': { 'test': 'something' },
'queueID': 'queue',
'method' : 'post'
});
});
$('#uploadbutton').attr('href', "javascript:$('#file_upload').uploadifive('upload')");
} else {
$(function () {
$('#file_upload').uploadify({
'swf': '../../../../uploadify/uploadify.swf',
'uploader': 'uploader.php',
'auto': false,
'formData': { 'test': 'something' },
'queueID': 'queue'
});
});
$('#uploadbutton').attr('href', "javascript:$('#file_upload').uploadify('upload')");
}
<script type="text/javascript">
if(swfobject.hasFlashPlayerVersion("1"))
{
//flash
$(function () {
$("#file_uploader").uploadify({
uploader: 'uploadify.swf',
script: '#script_url#',
scriptData: {#json_params#},
folder: '/#folder_path#',
method:'GET',
fileDataName: 'file',
buttonText: 'Upload File?',
multi: false,
removeCompleted: true,
sizeLimit: 1024*1024*10, // 10mb
fileExt: '#uploadify_allowed_file_extensions#',
fileDesc: '#uploadify_allowed_file_extensions#',
simUploadLimit: 1,
cancelImg: 'cancel.png',
auto: true,
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.info / (1024 * 1024)) + "MB");
else
alert("error " + d.type + ": " + d.text);
},
onComplete: function (event, queueId, fileObj, response, data) {
if (response.indexOf('display') > -1)
$("##file_uploader_area .results").html(response);
else
location.href='#refresh_url#';
}
});
});
}
else
{
//no flash
$(function () {
$("#file_uploader").uploadifive({
uploadScript: '#script_url##url_params#',
scriptData: {#json_params#},
method:'POST',
fileObjName: 'file',
buttonText: 'Upload File?',
multi: false,
removeCompleted: true,
sizeLimit: 1024*1024*10, // 10mb
fileType: #uploadifive_allowed_mime_json#,
simUploadLimit: 1,
cancelImg: 'cancel.png',
auto: true,
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.info / (1024 * 1024)) + "MB");
else
alert("error " + d.type + ": " + d.text);
},
onUploadComplete: function (file, data) {
if (data.indexOf('display') > -1)
$("##file_uploader_area .results").html(data);
else
location.href='#refresh_url#';
}
});
});
}
</script>
<div id="file_uploader_area">
<div class="results"></div><br>
<input type="file" name="file_uploader" id="file_uploader" />
</div><br>