將upload.php放在Server
內容如下
<?php
$filename = $_GET['filename'];
$fileData = file_get_contents('php://input');
$fhandle = fopen($filename, 'wb');
fwrite($fhandle, $fileData);
fclose($fhandle);
echo("FROM PHP: Done uploading.");
?>

Gohome 發表在 痞客邦 留言(0) 人氣()

  有時候因為程式的需求會需要用檔名來取得Resource id
import java.lang.reflect.Field;

public int getResId(String variableName, Class<?> c) {
try {
Field idField = c.getDeclaredField(variableName);
return idField.getInt(idField);
} catch (Exception e) {
e.printStackTrace();
return -1;
}
}

Gohome 發表在 痞客邦 留言(0) 人氣()

1
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。