Php Android PDF发送到数据库
我想把我新创建的PDF发送到我的数据库,但我不知道从哪里开始。我可以通过Php Android PDF发送到数据库,php,android,database,pdf,Php,Android,Database,Pdf,我想把我新创建的PDF发送到我的数据库,但我不知道从哪里开始。我可以通过AsyncTask通过链接发送一些变量,但我不能发送我的pdf。数据库可以获取刚刚找到的变量,但只要我尝试发送pdf,数据库中的所有内容都是空的。我必须补充的是,我的pdf在数据库中保存为blob Android应用程序 //File byte[] byteArray = myFile.getBytes("UTF-8"); base64 = Base64.encodeToString(byteArray, Base64.
AsyncTask
通过链接发送一些变量,但我不能发送我的pdf。数据库可以获取刚刚找到的变量,但只要我尝试发送pdf,数据库中的所有内容都是空的。我必须补充的是,我的pdf在数据库中保存为blob
Android应用程序
//File
byte[] byteArray = myFile.getBytes("UTF-8");
base64 = Base64.encodeToString(byteArray, Base64.DEFAULT);
url = new URL("http://aga14773.webspace.spengergasse.at/kundenexecute.php" +
"?firstname=" + firstname + "&"
+ "lastname=" + lastname + "&"
+ "postalcode=" + postalcode + "&"
+ "citytext=" + citytext + "&"
+ "address=" + address + "&"
+ "e_mail=" + e_mail + "&"
+ "birthday=" + birthday + "&"
+ "test=" + base64);
// + "pdf=" + blobData);
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setDoOutput(true);
PHP文件
<?php
include "db.inc.php";
include "redirect.php";
session_start();
/*
$id=$_POST['id'];
$data=$_POST['stringdata'];
echo $id;
*/
$conn = mysqli_connect($db_server, $db_user, $db_password, $db_name) or die("you did not connect bozo");
$postleitzahl = $_GET['postalcode'];
$firstname = $_GET['firstname'];
$lastname = $_GET['lastname'];
$citytext = $_GET['citytext'];
$address = $_GET['address'];
$e_mail = $_GET['e_mail'];
$birthday=$_GET['birthday'];
$test=$_GET['test'];
echo $test;
$statement = $conn->prepare("INSERT INTO kunden(kunden_plz, kunden_nachname, kunden_vorname, kunden_adresse, kunden_ort, kunden_email, kunden_geburtsdatum) VALUES (?,?,?,?,?,?,?)");
$statement->bind_param("sssssss", $postleitzahl, $firstname,$lastname,$citytext,$address,$e_mail,$birthday);
$statement->execute();
?>