Android PHP GET Base64

时间:2017-03-20 22:46:35

标签: php android database

我想从我的Android应用程序解析一些数据到我的网站。其中一个数据是pdf,另一个数据只是整数或字符串。我保存数据的尝试工作,除非我想解析包含pdf的base64字符串。在数据库中,新插入的行在每个字段中都为空。检索base64字符串后我想要做的是使用base64字符串生成BLOB。

的Android

apiKey

PHP文件

 //Read text from file
            BufferedReader input = null;
            input = new BufferedReader(
                    new InputStreamReader(openFileInput(myFile)));
            String line;
            StringBuffer buffer = new StringBuffer();
            while ((line = input.readLine()) != null) {
                buffer.append(line + "\n");
            }
            String text = buffer.toString();

            byte[] byteArray = text.getBytes("UTF-8");

            String base64= Base64.encodeToString(byteArray, Base64.DEFAULT);

            Log.d("HERE I AM", base64);

            url = new URL("http://website.com/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();
            InputStream a = new BufferedInputStream(urlConnection.getInputStream());
            postalcode = String.valueOf(Integer.valueOf(convertStreamToString(a)));
            urlConnection.disconnect();

>

在尝试使用base64且没有

之前,我的数据库的外观如何

Database picture

0 个答案:

没有答案