jQuery 파일 업로드 플러그인을 내 사이트 https://github.com/blueimp/jQuery-File-Upload/wiki/Basic-plugin에 추가하려고 시도 중입니다. 메신저는 Laravel 프레임 워크를 사용하고 있습니다.Laravel 및 jQuery 파일 업로드
{{ Form::open(['action' => '[email protected]'])}}
{{ Form::text('name')}} <br><br>
<input id="fileupload" type="file" name="files[]" data-url="server/php/" multiple>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="theme-admin/fileupload/js/vendor/jquery.ui.widget.js"></script>
<script src="theme-admin/fileupload/js/jquery.iframe-transport.js"></script>
<script src="theme-admin/fileupload/js/jquery.fileupload.js"></script>
<script>
$(function() {
$('#fileupload').fileupload({
url: '/gallery',
dataType: 'json',
done: function (e, data) {
$.each(data.result.files, function (index, file) {
$('<p/>').text(file.name).appendTo(document.body);
});
},
progressall: function (e, data) {
var progress = parseInt(data.loaded/data.total * 100, 10);
$('#progress .bar').css(
'width',
progress + '%');
}
});
});
</script>
<br>
<input type="submit">
{{ Form::close() }}
<div id="progress">
<div class="bar" style="width: 0%;"></div>
</div>
일부 자바 스크립트 경로를 호출 이미지를 선택한 후 : *website*/server/php
이 곳의 index.php이지만, Laravel 오류 반환, 그 경로를 재 지정된다
이 내보기에 net::ERR_TOO_MANY_REDIRECTS
을. 나는 MyController에의 @의 serverphp 방법에 index.php를 새로운 노선과 CopyPaste에 스크립트를 추가하는 tryed했지만, 같은 오류가 발생했습니다 :
Route::get('server/php', array('as' => 'serverphp', 'uses' => '[email protected]'));
내가 지금 어떻게해야합니까?
파일 업로드 js를 보면서/gallery URL로 이미지를 보내야합니다. 다른 것이 index.php로 사용자를 리디렉션하는 경우 해당 부분이 무엇인지 찾아서 index.php로 리디렉션하지 마십시오. – jvv