谁能告诉如何将值从 jquery 传递给 uploadify.php dynfolder:$("#storeloyaltyid").val()
,//值是 photo1 m 无法在 uploadify.php 中获取
jQuery
if($("#uploadphotoz").length>0){
uploadphotoz();
}
function uploadphotoz(){
$('#uploadphotoz').Uploadify({
uploader:urljs+"/jslib/Uploadify.swf",
cancelImage:urljs+"/image/cancel.png",
buttonImage:urljs+"/image/browse_button.png",
uploadUrl:urljs+"/jslib/uploadify.php",
dynfolder:$("#storeloyaltyid").val(),//value is photo1
height : 21,
width :59,
auto : true,
fileLimit:1,
preview:'stuimgpreview',
onComplete: function(event,status,imgs){
$("#memPhoto").val(imgs);
},
onRemove:function(event,imgs){
$("#memPhoto").val(imgs);
}
});
}
上传.php
<?php
if (!empty($_FILES)) {
$filename = $_FILES['Filedata']['name'];
$filetmpname = $_FILES['Filedata']['tmp_name'];
$fileType = $_FILES["Filedata"]["type"];
$fileSizeMB = ($_FILES["Filedata"]["size"] / 1024 / 1024);
// Place file on server, into the images folder
//move_uploaded_file($_FILES['Filedata']['tmp_name'], "../uploaded_photos/".$filename);
$dynfolder=$_POST['dynfolder'];
mkdir($dynfolder, 0755, true);move_uploaded_file($_FILES['Filedata']['tmp_name'], "../uploaded_photos"."/".$dynfolder."/".$filename);.../uploaded_photos/photos1/1.jpg
}elseif($_POST['d']){
$filename = $_POST['d'];
$dynfolder=$_POST['dynfolder'];
mkdir($dynfolder, 0755, true);
$dFile=move_uploaded_file($_FILES['Filedata']['tmp_name'], "../uploaded_photos"."/".$dynfolder."/".$filename);//.../uploaded_photos/photos1/1.jpg
unlink($dFile);
}
?>
我无法在uploaded_photos 文件夹中创建一个名为photos1 的新文件夹......路径应该是.../uploaded_photos/photos1/1.jpg
,,dynfolder:$("#storeloyaltyid").val(),//value is photo1
谁能告诉代码有什么问题。