五分赛车

网站开发

网罗一切网站作育开发相关的教程内容,如CSS教程,JS教程,html教程,服务器装备,域名空间的购置教程.

应用阿里巴巴图片外链来制造收费图床

揭晓于:2019-06-16 点击: 栏目:

网站开发

之前为人人分享了应用百度和新浪图片上传接口制造图床的措施,现在似乎都不克不及用了。明天为人人分享一款应用阿里巴巴来做图床的措施。

PHP应用百度当图床

PHP应用百度当图床

网站开发

百度识图信托人人都不生疏随便任性上传一张图片,便可找到图片泉源和其它的类似图片等,异常好用!不知道...

点击检查

php应用微博当图床

php应用微博当图床

网站开发

现在已知有两个措施能完成,其一是应用微博官方的开放平台的发微博 API 完成。这类措施也是我最早...

点击检查

首先我们来看看代码事实效果

应用阿里巴巴图片外链来制造收费图床

测试是正常上传完善无错的

阿里巴巴图床代码

<!DOCTYPE html>
<html>
<head>
<meta name="referrer" content="no-referrer"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<title>永信五分赛车-五分赛车计划收费图床 - 阿里巴巴稳固图片外链www.0du123.com</title>
<meta name="keywords" content="uomg,优启梦,新浪图床,淘宝图床,图片外链,稳固图床,收费图床,群集图片,图片库,相册,群集相册,批量上传,批量天生">
<meta name="description" itemprop="description" content="优启梦永世收费图床,稳固图片外链;支持批量上传,即时预览,不限制流量,不限制外链数,永世生涯,阿里巴巴图片服务器,全网CDN图床,高速稳固,支持网页,手机上传,无需插件,支持JPG,GIF,PNG等文件名堂,微博图床,土豆是个好图床"/>
<link rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://lib.baomitu.com/prettify/latest/prettify.css">
<script rel="stylesheet" src="https://lib.baomitu.com/layer/3.1.1/mobile/layer.js"></script>
<style type="text/css">
    body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,'sans-serif';background: url(https://api.uomg.com/api/image.lofter?format=images); background-size: cover;}
    @font-face {font-family: 'webfont_2';
        src: url('//at.alicdn.com/t/webfont_bar76uyhrpd.eot'); /* IE9*/
        src: url('//at.alicdn.com/t/webfont_bar76uyhrpd.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
        url('//at.alicdn.com/t/webfont_bar76uyhrpd.woff') format('woff'), /* chrome、firefox */
        url('//at.alicdn.com/t/webfont_bar76uyhrpd.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
        url('//at.alicdn.com/t/webfont_bar76uyhrpd.svg#思源黑体-极细') format('svg'); /* iOS 4.1- */
    }
    .text-center{text-align: center;}
    .text-white{color: #FFF;}
    .header,.footer{margin: 30px;color:#fff;}
    .title1{font-size: 20px;}
    .title2{font-size: 24px;font-family:"webfont_2" !important;}
    .jumbotron{margin: auto;text-align: center;background-color: rgba(255, 255, 255, .3);}
    .jumbotron input[type=file] {opacity:0;width:102px;height:31px;position:absolute;display:inline-block;}
    .preview {color: #fff;}
    .preview img {max-width: 10%;}
    .preview p {word-break: break-all;word-wrap: break-word;font-size: 13px !important;}
    .form-control:focus{background-color: rgba(255, 255, 255, .3);}
</style>
</head>
<body>
    <div>
        <div>
            <div class="span12 header text-center">
                <p>© 永信五分赛车-五分赛车计划收费图床</p>
                <p>阿里巴巴图片外链服务 稳固不掉落落线 收费应用</p>
            </div>
            <div class="col-md-8 col-xs-10 jumbotron" style="margin:auto;">
                <div>
<a href="http://jeffstef.com"><button class="btn btn-primary btn-sm">永信五分赛车-五分赛车计划</button></a>
                    <input type="file" accept="image/*" multiple>
                    <button type="button" class="btn btn-primary btn-sm">选择当舆图片</button>
                    <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#url_upload_model">上传远程图片</button>                   
                </div><hr>
                <textarea id="url-res-txt" rows="5" placeholder="上传后的图片外链地址将显示在此处,下方会同时显示外链地址和预览图。"></textarea>
                <div>
                    <hr>
                </div>
                <span><b>温馨提醒:</b> 本站不存储且无权治理上传的图源,图源均存放在新浪服务器,切勿上传背背律例图源,否则效果自尊。</span>
            </div>
            <div class="footer text-center">
                <a target="_blank">© 2019 Powered by 永信五分赛车-五分赛车计划.</a>
            </div>
        </div>
    </div>
    <div id="url_upload_model" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
     <div>
     <div>
     <div>
     <h4 id="myModalLabel">上传远程图片</h4>
     </div>
     <div>
     <p>
     请不才方输入远程图片地址~每行一个~
     </p>
     <textarea name="urls" rows="3" id="urls"></textarea>
     </div>
     <div>
     <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
     <button type="button" class="btn btn-primary" onClick="url_upload();">提交</button>
     </div>
     </div>
     </div>
    </div>
    <script src="https://lib.baomitu.com/jquery/3.4.0/jquery.min.js" type="text/javascript"></script>
    <script src="https://lib.baomitu.com/twitter-bootstrap/4.3.1/js/bootstrap.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        var url = 'https://api.uomg.com/api/image.ali';
        $(document).ready(function() {
            $("input[type='file']").change(function(e) {
                file_upload(this.files)
            });
            var obj = $('body');
            obj.on('dragenter', function(e) {
                e.stopPropagation();
                e.preventDefault()
            });
            obj.on('dragover', function(e) {
                e.stopPropagation();
                e.preventDefault()
            });
            obj.on('drop', function(e) {
                e.preventDefault();
                file_upload(e.originalEvent.dataTransfer.files)
            });
        });
        function file_upload(files){
            if (files.length == 0) return alert('请选择图片文件!');
            for(var j = 0,len = files.length; j < len; j++){
                console.log(files[j]);
                let imageData = new FormData();
                imageData.append("file", 'multipart');
                imageData.append("Filedata", files[j]);
                $.ajax({
                    url: url,
                    type: 'POST',
                    data: imageData,
                    cache: false,
                    contentType: false,
                    processData: false,
                    dataType: 'json',
                    // 图片上传告成
                    success: function (result) {
                        if (result.code == 1){
                            $('.preview').append('<div><img src="'+result.imgurl+'" ><code>'+result.imgurl+'</code></div>');
                        }else{
                            layer.msg('第'+j+'个图片上传掉落败');
                        }
                    },
                    // 图片上传掉落败
                    error: function () {
                        console.log('图片上传掉落败');
                    }
                });
            }
        }
        function url_upload(){
            var urls = $('#urls').val();
            if (urls == false) return alert('请输入图片链接!');
            var UrlArr = urls.split("\n");
            $('#url_upload_model').modal('hide');
            for(var j = 0,len = UrlArr.length; j < len; j++){
                console.log(UrlArr[j]);
                $.getJSON(url, {imgurl: UrlArr[j]}, function(result, textStatus) {
                    if (result.code == 1){
                        $('.preview').append('<div><img src="'+result.imgurl+'" ><code>'+result.imgurl+'</code></div>');
                    }else{
                        layer.msg('第'+j+'个图片上传掉落败');
                    }
                    console.log(result);
                });
            }
        }
    </script>
</body>
</html>

以上代码人人可以凭证请求自行修改。