9 * 1024){ die ('{error: "server-error file size is bigger than 9kB"}'); } if (count($_GET)){ array_merge($_GET, array('fileName'=>$fileName)); $response = array_merge($_GET, array('success'=>true, 'fileName'=>$fileName)); // to pass data through iframe you will need to encode all html tags echo htmlspecialchars(json_encode($response), ENT_NOQUOTES); } else { die ('{error: "server-error query params not passed"}'); }