Hãy cho tôi biết nếu có ai biết vấn đề với mã này là gì.Tải lên tệp PHP bằng cách sử dụng bài đăng jquery
Về cơ bản tôi muốn tải lên một tập tin sử dụng jQuery
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function(event) {
$('#form1').submit(function(event) {
event.preventDefault();
$.post('post.php',function(data){
$('#result').html(data);
});
});
});
</script>
</head>
<body>
<form id="form1">
<h3>Please input the XML:</h3>
<input id="file" type="file" name="file" /><br/>
<input id="submit" type="submit" value="Upload File"/>
</form>
<div id="result">call back result will appear here</div>
</body>
</html>
và php của tôi 'post.php'
<?php
echo $file['tmp_name'];
?>
Tải Lên File name không quay trở lại. Vấn đề là tôi không thể truy cập tệp được tải lên.
Cảm ơn trước! Shiv
anh đang làm gì –