完成 商品 规格 分类 运费模板 等功能
This commit is contained in:
44
public/UEditor22/php/action_crawler.php
Normal file
44
public/UEditor22/php/action_crawler.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* 抓取远程图片
|
||||
* User: Jinqn
|
||||
* Date: 14-04-14
|
||||
* Time: 下午19:18
|
||||
*/
|
||||
set_time_limit(0);
|
||||
include("Uploader.class.php");
|
||||
|
||||
/* 上传配置 */
|
||||
$config = array(
|
||||
"pathFormat" => $CONFIG['catcherPathFormat'],
|
||||
"maxSize" => $CONFIG['catcherMaxSize'],
|
||||
"allowFiles" => $CONFIG['catcherAllowFiles'],
|
||||
"oriName" => "remote.png"
|
||||
);
|
||||
$fieldName = $CONFIG['catcherFieldName'];
|
||||
|
||||
/* 抓取远程图片 */
|
||||
$list = array();
|
||||
if (isset($_POST[$fieldName])) {
|
||||
$source = $_POST[$fieldName];
|
||||
} else {
|
||||
$source = $_GET[$fieldName];
|
||||
}
|
||||
foreach ($source as $imgUrl) {
|
||||
$item = new Uploader($imgUrl, $config, "remote");
|
||||
$info = $item->getFileInfo();
|
||||
array_push($list, array(
|
||||
"state" => $info["state"],
|
||||
"url" => $info["url"],
|
||||
"size" => $info["size"],
|
||||
"title" => htmlspecialchars($info["title"]),
|
||||
"original" => htmlspecialchars($info["original"]),
|
||||
"source" => htmlspecialchars($imgUrl)
|
||||
));
|
||||
}
|
||||
|
||||
/* 返回抓取数据 */
|
||||
return json_encode(array(
|
||||
'state'=> count($list) ? 'SUCCESS':'ERROR',
|
||||
'list'=> $list
|
||||
));
|
Reference in New Issue
Block a user