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

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -