【发布时间】:2017-04-08 16:23:21
【问题描述】:
我必须使用 slim 3 在服务器上上传图像文件。我想将文件路径保存在表中,并将相应图像保存在服务器上的文件夹中
$filenamePath = md5(time().uniqid()).".jpg";
$decoded=base64_decode($image);
file_put_contents("images/".$filenamePath,$decoded);
$sth = $this->db->prepare("UPDATE orders set status =:status,
total_amount=:amount,created_at=:date1,receipt=:path WHERE id=:orderId");
$sth->bindParam("orderId",$orderid );
$sth->bindParam("status", $status);
$sth->bindParam("amount", $amount);
$sth->bindParam("date1", $date);
$sth->bindParam("path", $filenamePath);
$sth->execute();
这是我在 slim 3 类中的代码 this is my directory stucture of folder on server 怎么了?谁能帮忙?
【问题讨论】:
-
您是否遇到任何错误?
-
i have to upload image file on server using slim 3。那么出了什么问题?它与 Android 有什么关系? -
无法打开流没有这样的文件或目录..这个错误存在
-
???那个错误在哪里?而且你没有说它与 Android 有什么关系。