我想知道使用AsyncTask将图像插入数据库的人......
这是我的Java代码:
protected String doInBackground(String... params) {
........
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("image", image));
服务器端我正在使用数据库插入图像的URL ...
$path = "news/"."$sswebsite.png";
$actualpath = "example.com"."$path";
print_r($actualpath);
$sql = "Insert into user(nome, email, password, state, last_login)
values('$name','$email','$sswebsite','1',now(), '$actualpath')";
$result = mysqli_query($link, $sql);
if(!$result)
{
die("error in query #1". mysqli_error($link));
}
if($result)
{
echo 'success';
print_r($image);
file_put_contents($path,base64_decode($image));
图片路径不保存,图片不保存到文件夹...
如果我转到我在POSTMAN提交图片中测试的url_image
,则会出现服务器错误未找到
The requested URL /admin/news/d41d8cd98f00b204e9800998ecf8427e.png was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.