0
我使用croppie插件來裁剪完美的圖像。該圖像存儲在我的文件夾中,圖像大小顯示爲零字節。它在本地主機上運行良好,但在服務器上無法正常工作。你能幫我嗎?使用php在服務器上傳後顯示零字節的圖像尺寸
<form action="process.php" id="form" method="post">
<div id="upload-demo"></div>
<input type="hidden" id="imagebase64" name="imagebase64">
<input type="submit" name="submit" value="save" class="upload-result">
</form>
if(isset($_POST['submit'])){
$data = $_POST['imagebase64'];
list($type, $data) = explode(';', $data);
list(, $data) = explode(',', $data);
$data = base64_decode($data);
$imageName = time().'.png';
file_put_contents('images/profile/'.$imageName, $data);
// echo $imageName;
}
感謝回答Mr.acmsohail,它正在爲me.upvote從我身邊 –
@NarendraVerma隨時歡迎:) – acmsohail