Flex端利用new PNGEncoder().encode(bitmapData)将png图片转换为ByteArray,然后传给服务器,服务端需要定义一个public ByteArray UploadImage(ByteArray ba)方法 服务器端相关代码 using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Drawing; using System…
创建一个 models/UploadForm.php: <?php namespace app\models; use yii\base\Model; use yii\web\UploadedFile; /** * UploadForm is the model behind the upload form. */ class UploadForm extends Model { /** * @var UploadedFile file attribute */ public $file; /*…