2017-10-13 57 views
1

如何爲圖像創建臨時文件名從Android應用程序發佈

<?php 
 
        // Get image string posted from Android App 
 
        $base=$_REQUEST['image']; 
 
       // Get file name posted from Android App 
 
       
 
        $filename = $_REQUEST['filename']; 
 
        
 
       // Decode Image 
 
        $binary=base64_decode($base); 
 
        header('Content-Type: bitmap; charset=utf-8'); 
 
       
 
        $file = fopen('uploads/'.$filename, 'wb'); 
 
       // Create File 
 
        fwrite($file, $binary); 
 
        fclose($file); 
 
        echo 'Image upload complete, Please check your php file directory'; 
 
       ?>

在Android App.I張貼獲取圖像串和文件名,這是我的PHP代碼需要爲image.Can創建temprory文件名任何人幫助?

回答

相關問題