我想獲取上傳文件的完整路徑。 PHP代碼是這樣的:PHP上傳路徑中沒有斜槓
<?php
$destination_path = getcwd() . DIRECTORY_SEPARATOR;
$result = 0;
$target_path = $destination_path . basename($_FILES['thefile']['name']);
if(@move_uploaded_file($_FILES['thefile']['tmp_name'],*$target_path)) {
$result = 1;
}
?>
<script language="javascript" type="text/javascript">
//d = '<?php echo basename($_FILES['thefile']['name']); ?>';
d = '<?php echo $target_path; ?>';
window.top.window.phpUpload(d);
</script>
我可以打開與rem'd脫節的JSON文件,但我需要的路徑,在會話結束返回。用警報進行測試時,顯示的是完整路徑,沒有斜槓,文件名缺失的首字母'n'...
任何幫助非常感謝。
(點擊名稱,然後在此test site開放nset.json看到我想要做的)
這應該是一個評論,不是答案。 – fredley 2011-03-11 00:56:41
謝謝傑里米。解決了斜線問題後,我發現你說的是什麼。我想讓遊客選擇從窗口保存到文件或c + p。所以現在我會給出一個下載鏈接作爲選項。 – 2011-03-11 02:19:07