js實現分割上傳大文件_javascript技巧
來源:懂視網
責編:小采
時間:2020-11-27 20:52:00
js實現分割上傳大文件_javascript技巧
js實現分割上傳大文件_javascript技巧:本文實例介紹了js上傳文件操作,分享給大家供大家參考,具體內容如下 分割大文件上傳 #test{ width: 200px; height: 100px; border: 1px solid green; display: none; } #img{ width: 50px; height: 50px;
導讀js實現分割上傳大文件_javascript技巧:本文實例介紹了js上傳文件操作,分享給大家供大家參考,具體內容如下 分割大文件上傳 #test{ width: 200px; height: 100px; border: 1px solid green; display: none; } #img{ width: 50px; height: 50px;
本文實例介紹了js上傳文件操作,分享給大家供大家參考,具體內容如下
file.php:
<?php
/****
waited
****/
//print_r($_FILES);exit;
$file = $_FILES['mof'];
$type = trim(strrchr($_POST['test'], '.'),'.');
// print_r($_POST['test']);exit;
if($file['error']==0){
if(!file_exists('./upload/upload.'.$type)){
if(!move_uploaded_file($file['tmp_name'],'./upload/upload.'.$type)){
echo 'failed';
}
}else{
$content=file_get_contents($file['tmp_name']);
if (!file_put_contents('./upload/upload.'.$type, $content,FILE_APPEND)) {
echo 'failed';
}
}
}else{
echo 'failed';
}
?>
1 運行:

2 選擇2G文件測試:

3 完成并正常播放:

聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
js實現分割上傳大文件_javascript技巧
js實現分割上傳大文件_javascript技巧:本文實例介紹了js上傳文件操作,分享給大家供大家參考,具體內容如下 分割大文件上傳 #test{ width: 200px; height: 100px; border: 1px solid green; display: none; } #img{ width: 50px; height: 50px;