Ejemplo n.º 1
0
    private void OnUploadItemFinish(string file, string md5png)
    {
        uploadCounter++;
        var success = !string.IsNullOrEmpty(md5png);

        if (success)
        {
            var url = UploadUtility.GetDownloadFileUrl(md5png);
            Debug.Log("===上传完成>>" + url);
            if (thumbFiles.ContainsKey(file))
            {
                thumbFiles[file] = url;
            }
        }
        else
        {
            uploadMsg = string.Format("上传至文件服务器失败!名称:{0}", Path.GetFileName(file));
        }

        if (uploadCounter >= thumbFiles.Count)
        {
            thumbFiles.Values.ForEach(t =>
            {
                if (t.IsNotNullAndEmpty())
                {
                    mUploadFiles.items.Add(t);
                }
            });
            onFinish.InvokeGracefully(mUploadFiles, uploadMsg);
        }
    }
Ejemplo n.º 2
0
    public static void TestUpload()
    {
        var filePath = SavePath + "/35/sticker_prefab_ppbbbmhmf_10_common.png";

        UploadUtility.UploadFile(filePath, (res, msg) =>
        {
            Debug.Log(UploadUtility.GetDownloadFileUrl(res));
        });
    }