2017-10-13 63 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文件名任何人帮助?

回答

相关问题