<?php
if($v['type']=="image"):
?>
<div id="fileQueue"></div>
<input type="file" id="uploadify" name="Filedata" />
<div>
<a href="javascript
('#uploadify').uploadify('upload','*')">上传</a>
<a href="javascript
('#uploadify').uploadify('cancel')">取消上传</a>
</div>
<input type="text" style="" name="
<?php echo $v['name']?>" id="
<?php echo $v['name']."_id"?>" value=""/>
<input type="hidden" style="" name="poster" id="
<?php echo $v['name']."_id_1"?>" value=""/>
<link href="
<?php echo $this->config->item("base_url");?>asset/js/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="
<?php echo $this->config->item("base_url");?>asset/js/uploadify/jquery.uploadify-3.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("#uploadify").uploadify({
'debug':false,
'swf': '
<?php echo $this->config->item("base_url");?>asset/js/uploadify/uploadify.swf',
'uploader': '
<?php echo $this->config->item("base_url");?>photo/savephoto',
'method':"post",
'height':30,
'width':120,
'queueID': 'fileQueue',
'auto': false,
'multi': false,
'fileTypeDesc':'只允许上传jpg格式图片',
'fileTypeExt':'*.jpg',
'fileSizeLimit' : '10MB',
'formData' : { '
<?php echo session_name();?>' : '
<?php echo $this->session->userdata('session_id');?>' },
'onUploadError' : function (file,errorCode,errorMsg,errorString) {
alert('The file ' + file.name + ' could not be uploaded: ' + errorString);
},
'onUploadSuccess':function(file,data,response){
alert(data);
$("#
<?php echo $v['name']."_id"?>").val(data);
$("#
<?php echo $v['name']."_id_1"?>").val(data);
}
});
})
</script>
<?php endif;?>