나는 Blueimp jQuery 파일 업 로더 을 구현하려고하고 있으며, 내 PHP 기반 사이트에서 작동하도록 초조 한 시간을 보내고 있습니다.Blueimp jQuery 파일 업 로더를 PHP와 함께 사용하는 방법?
내 주요 문제는 AJAX입니다. 는 내가 뭘 원하는
- 가 리디렉션 것
abc.php
을 (의 말)하자, 업로드 후입니다. - (페이지를 리디렉션하기 전에) 업로드 한 후 파일 이름을 MySQL 데이터베이스에 저장하려고합니다.
PHP로 데이터베이스를 처리하는 방법을 알고 있지만 PHP 코드를 어디에 둘 수 없는지 잘 모릅니다. 내가 만에 main.js
$(function() {
'use strict';
// Initialize the jQuery File Upload widget:
$('#fileupload').fileupload();
// Enable iframe cross-domain access via redirect option:
$('#fileupload').fileupload(
'option',
'redirect',
window.location.href.replace(
/\/[^\/]*$/,
'/cors/result.html?%s'
)
);
// Load existing files:
$('#fileupload').each(function() {
var that = this;
$.getJSON(this.action, function (result) {
if (result && result.length) {
$(that).fileupload('option', 'done')
.call(that, null, {result: result});
}
});
});
});
감사를 변경해야 할 것 같아요 첫 번째 문제를 들어
..