what code should be in upload.php for jquery swfupload? -
i started using jquery swfupload plugin , have working besides upload part... don't know put in upload.php file.
i error: alert: {"name":"","type":"","size":""}; file: mayday-parade.png
upload.php had code:
$file = $_files['file']; echo '{"name":"'.$file['name'].'","type":"'.$file['type'].'","size":"'.$file['size'].'"}';
obviously doesn't work added following:
if (file_exists($_server['document_root'].'/band_photos/' . $_files["file"]["name"])) { echo 'file exists'; } else { $uploaddir = 'uploads/'; $uploadfile = $uploaddir . basename($_files['file']['name']); if(move_uploaded_file($_files["file"]["tmp_name"], $uploadfile)) { echo 'success'; } else { echo 'error'; } }
i can't seem find out i'm doing wrong. can help?
have changed the file_post_name in swfupload's settings "file"?
if not, $_files['file']
not return anything, because default-name filedata , use $_files['filedata']
instead.
Comments
Post a Comment