Ben bir type = "file" form alan ve yüklemeler bir ilerleme çubuğu kullanarak bir dosyayı alır gömülü iframe formu var:
<form action="sell_upload.php" method="post" id="uploadform" enctype="multipart/form-data">
<input type="hidden" name="UPLOAD_IDENTIFIER" id="progress_key" value="<?= $uuid ?>" />
<input type="hidden" name="uploaded" value="yes" />
<input type="hidden" name="MAX_FILE_SIZE" value="2097152" />
<input type="file" name="ulfile1" id="ulfile1" onChange="beginUploadNew();"/>
beginUploadNew () ([yerine göndermek tıklayarak] onChange için shortcutted olan) teslim üzerinde yürütülür:
function beginUploadNew(){
$('#uploadform').submit();
$("#uploadprogressbar").fadeIn();
progress_key= $("#progress_key").val();
alert (progress_key);
var i = setInterval(function()
{
$.getJSON("uploadprogress.php?id=" + progress_key, function(data)
{
if (data == null)
{
clearInterval(i);
location.reload(true);
//alert ("oh noes2");
return;
}
//alert ("oh noes3");
//alert (parseInt(data.bytes_total));
var percentage = Math.floor(100 * parseInt(data.bytes_uploaded) / parseInt(data.bytes_total));
$("#uploadprogressbar").progressBar(percentage);
});
}, 1000);
return true;}
The PROBLEM: Sometimes(usually the first time that i press that submit button) it seems that everything is going ok, the loading bar fades in, just as the script is written, then abruptly reloads the page as it nothing has happened. I'm uploading 1.5 meg pictures for testing, and there is certainly not enough time to have passed for it to have uploaded.
Ve Bazen sadece ince yüklenenler.
Herhangi bir öneri? Ben kesinlikle ana sayfa ve yüklemek için iframe hem uzun enogh bekliyorum, o yüzden o sorunu olmamalıdır.
Thanks, Jason