<?php
if(isset($_GET['soobest_sessid'])){
again_favourable_picsave($_FILES['Filedata']);
}
function again_favourable_picsave($FILE){
//if(!intval($id)) return false;
$img_path = '';
$tmp_dir = 'E:\wamp\www\moban\pic0/'.$img_path;
if(!dir($tmp_dir))@mkdir($tmp_dir, 0777, true);
$ext = end(explode('.', $FILE['name']));
$tmp_name = $tmp_dir.time().'.'.$ext;
if ( @move_uploaded_file($FILE['tmp_name'], $tmp_name)){
return true;
}
return true;
}
?>
<!--{*上传Zip包/*}-->
<link href="styles/swfupload.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="swf/swfupload.js"></script>
<script type="text/javascript" src="swf/swfupload.queue.js"></script>
<script type="text/javascript" src="swf/fileprogress.js"></script>
<script type="text/javascript" src="swf/filegroupprogress.js"></script>
<script type="text/javascript" src="swf/handlers.js"></script>
<form method="post" action="?" name="listForm" >
<!-- start favourable list -->
<a onclick="again_upload();">upload</a>
<div class="overlay">
<div class="overlaytop">
<div id="spanButtonPlaceHolder"></div>
</div>
<div class="overlaygoods">
<table cellpadding="0" cellspacing="0" border="0" width="400">
<tr>
<td align="center"><div style="height:100px; width:400px; overflow:auto;" id="divprogresscontainer"></div></td>
</tr>
</table>
<div class="overlay_pages" id="divprogressGroup"></div>
</div>
</div>
</div>
<!-- end favourable list -->
</form>
<script type="text/javascript">
var swfu;
var sessid ='fdddddddddddddddffd';
function again_upload(id,img){
//jQuery('#show_act_do').html('addPic');
initSwfupload('spanButtonPlaceHolder','divprogresscontainer','divprogressGroup','',id,img);
}
function initSwfupload(buttonPlaceholderId,progressTargetId,progressGroupTargetId,color,id,img)
{
document.getElementById(progressTargetId).innerHTML ='';
document.getElementById(progressGroupTargetId).innerHTML ='';
var settings = {
flash_url: "/admin/swf/swfupload.swf",
upload_url: "/admin/swfup.php?soobest_sessid="+sessid,
file_size_limit: "200 MB",
file_types: "*.zip,*.jpg",
file_types_description: "请选择JPG图片",
file_upload_limit: 2,
file_queue_limit: 0,
custom_settings: {
progressTarget: progressTargetId,
progressGroupTarget : progressGroupTargetId,
//progress object
container_css: "progressobj",
icoNormal_css: "IcoNormal",
icoWaiting_css: "IcoWaiting",
icoUpload_css: "IcoUpload",
fname_css : "fle ftt",
state_div_css : "statebarSmallDiv",
state_bar_css : "statebar",
percent_css : "ftt",
href_delete_css : "ftt delBut",
//sum object
/*
页面中不应出现以"cnt_"开头声明的元素
*/
s_cnt_progress: "cnt_progress",
s_cnt_span_text : "fle",
s_cnt_progress_statebar : "cnt_progress_statebar",
s_cnt_progress_percent: "cnt_progress_percent",
s_cnt_progress_uploaded : "cnt_progress_uploaded",
s_cnt_progress_size : "cnt_progress_size"
},
debug: false,
// button_image_url: "images/TestImageNoText_65x29.png",
button_width: "180",
button_height: "20",
button_placeholder_id: buttonPlaceholderId,
button_text: '<span class="theFont">点击这里请选择JPG图片</span>',
button_text_style: ".theFont { font-size:14;color:#0000FF; }",
button_text_left_padding: 12,
button_text_top_padding: 3,
file_queued_handler: fileQueued,
file_queue_error_handler: fileQueueError,
upload_start_handler: uploadStart,
upload_progress_handler: uploadProgress,
upload_error_handler: uploadError,
upload_success_handler: uploadSuccess,
upload_complete_handler:uploadComplete,
file_dialog_complete_handler: fileDialogComplete,
queue_complete_handler: queueComplete
};
swfu = new SWFUpload(settings);
}
function upload_success_back(){
window.location.href='?act=favourable_img&id='+jQuery('#act_id').val();
}
</script>
- 1
- 2
前往页