我使用共享主机.
有可能发现PHP是通过fastCGI(或CGI)运行还是作为Apache模块运行mod_php?
是不是可以自己找出来,而不问主持人?
参考本教程.使用php跟踪上传进度.我想让它在Codeigniter中运行.我没有意识到开始让它在CI中发挥作用.我想上传文件并跟踪进度.
<?php $arr = array("id"=>"myform");
echo form_open_multipart("welcome/uploads",$arr); ?>
<input type="hidden" value="myForm" name="<?php echo ini_get("session.upload_progress.name"); ?>">
<table>
<tr>
<td>file</td>
<td><input type="file" name="images[]" multiple></td>
</tr>
<tr>
<td>name</td>
<td><input type="text" name="naam"></td>
</tr>
<tr>
<td></td>
<td><input type="submit"></td>
</tr>
</table>
<?php echo form_close(); ?>
<div id="bar_blank">
Run Code Online (Sandbox Code Playgroud)
function toggleBarVisibility() {
var e = document.getElementById("bar_blank");
e.style.display = (e.style.display == "block") ? "none" : "block";
}
function createRequestObject() {
var http;
if (navigator.appName == "Microsoft Internet Explorer") {
http = new ActiveXObject("Microsoft.XMLHTTP");
}
else …Run Code Online (Sandbox Code Playgroud) 我在一开始就遇到了PhP文件上传进度监视器的问题.
首先,这是相关的PhP.ini设置(指令,本地值和主值):
session.upload_progress.cleanup On On
session.upload_progress.enabled On On
session.upload_progress.freq 1% 1%
session.upload_progress.min_freq 1 1
session.upload_progress.name PHP_SESSION_UPLOAD_PROGRESS PHP_SESSION_UPLOAD_PROGRESS
session.upload_progress.prefix upload_progress_ upload_progress_
Run Code Online (Sandbox Code Playgroud)
这是表格(简化):
<form id="fileupload" style="position:relative;" target="iframe_fileupload" action="http://www.athiyoga.org/testupload.php" method="POST" enctype="multipart/form-data">
<input type="hidden" name="<?echo ini_get("session.upload_progress.name");?>" value="first"/>
<input type="file" name="file_1">
<button type="submit" >Start Submit</button>
</form>
Run Code Online (Sandbox Code Playgroud)
我有JQUERY Ajax代码,在同一个PhP文件中(当然,作为JS脚本),如:
$('#fileupload').submit(function(event){
//UPDATED THIS PART after reading: http://stackoverflow.com/questions/19336610/delay-in-populating-session-upload-progress-data
//POSTING the magic variable PHP_SESSION_UPLOAD_PROGRESS during status inquiry too
var params = {PHP_SESSION_UPLOAD_PROGRESS:"first", some_var:20 };
var data_params = jQuery.param( params );
setTimeout(function(){
upload_promise = $.ajax({
url: 'upload_status.php',
data: data_params,
dataType: …Run Code Online (Sandbox Code Playgroud)