<?php
if(empty($_FILES))
die(json_encode(array('code'=>-1,'msg'=>'error')));
$file = $_FILES['file'];
if($file['error']!=0 || $file['size']< 1 ){
die(json_encode(array('code'=>-1,'msg'=>'error','id'=>$_POST['id'])));
}
move_uploaded_file( $file['tmp_name'], "./upload/".$file['name']);
$file_db = "./upload/db.txt";
$db = array();
$rows = array();
if( file_exists($file_db) ){
$db = file($file_db);
foreach($db as $row){
$row = trim($row);
if(!empty($row)){
$row = explode("\t",$row);
$rows[$row[0]] = $row[1];
}
}
}
$rows[$file['name']] = $_POST['sort'];
$write_db = array();
foreach($rows as $key=>$val){
$write_db[] = trim($key."\t".$val);
}
$content = implode("\n",$write_db);
file_put_contents($file_db, $content);
echo json_encode( array( 'code'=>0, 'msg'=>'ok', 'id'=>$_POST['id'] ) );
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
jQuery PHP图片批量上传代码.zip (34个子文件)
css
demo.css 7KB
style.css 9KB
bootstrap.css 138KB
bootstrap-theme.min.css 13KB
webuploader-0.1.5
webuploader.flashonly.js 152KB
webuploader.withoutimage.min.js 42KB
webuploader.withoutimage.js 163KB
webuploader.css 500B
webuploader.html5only.min.js 50KB
webuploader.noimage.js 164KB
webuploader.noimage.min.js 43KB
webuploader.html5only.js 200KB
webuploader.min.js 70KB
webuploader.nolog.min.js 69KB
Uploader.swf 140KB
webuploader.custom.js 225KB
webuploader.flashonly.min.js 37KB
webuploader.js 274KB
webuploader.custom.min.js 52KB
webuploader.fis.js 273KB
webuploader.nolog.js 271KB
extend-webuploader.js 17KB
fileupdate.php 584B
filedel.php 605B
upload
fileinit.php 616B
images
bg.png 3KB
image.png 2KB
success.png 2KB
icons.png 3KB
progress.png 1KB
js
bootstrap.min.js 35KB
jquery.min.js 91KB
index.html 3KB
fileupload.php 871B
共 34 条
- 1
资源评论
xiaoshuo8431
- 粉丝: 5
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功