阿里云OSS上传工具是阿里云专用的上传功能了,下面我就为各位介绍一个阿里云OSS利用iframe实现图片异步上传了,这个例子非常的简单。
<script>ec(2);</script>
阿里云 OSS 图片上传iframe 实现异步上传 相关代码:
index.php:
代码如下 | 复制代码 |
/* ";<br> var_dump($_POST);<br> die;<br> }<br> ?> <p><br> <br> </p><br> <title></title><br> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><br> <script src="http://filela.b0.upaiyun.com/js/jquery-1.9.0.min.js"></script><br> <br> <br> <h1 id="添加操作">添加操作</h1><br> |
upload.php
代码如下 | 复制代码 |
$access_id = ''; $access_key = ''; $policy = '{"expiration": "2120-01-01T12:00:00.000Z","conditions":[{"bucket": "ioutsider" },["content-length-range", 0, 104857600]]}'; $policy = base64_encode($policy); $signature = base64_encode(hash_hmac('sha1', $policy, $access_key, true)); $file_name = date('Y') . '/' . date('m') . '/' . md5(microtime(true)) . '.jpg'; //print_r(get_headers('http://ioutsider.oss-cn-shenzhen.aliyuncs.com')); ?> |
上传成功后跳转的页面:
代码如下 | 复制代码 |
<script><br /> $(function(){<br /> alert('上传成功');<br /> window.parent.$('#res').append("<input type='hidden' value='<?php echo $img ?>' name='path'>")<br /> })<br /> </script> |
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article
Assassin's Creed Shadows: Seashell Riddle Solution
3 weeks agoByDDD
What's New in Windows 11 KB5054979 & How to Fix Update Issues
2 weeks agoByDDD
Where to find the Crane Control Keycard in Atomfall
3 weeks agoByDDD
Saving in R.E.P.O. Explained (And Save Files)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver Mac version
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment