Esempio n. 1
0
        public object uploadVideo([FromForm] UploadVideoInput input)
        {
            //将源文件 读取成文件流
            Stream fromFile = input.file.OpenReadStream();

            return(OSSService.uploadFile(fromFile, input.filename));
        }
Esempio n. 2
0
        public object uploadVideo([FromForm] UploadVideoInput input)
        {
            var filename = "upload/" + DateTime.Now.Second + input.filename;

            //将源文件 读取成文件流
            Stream fromFile = input.file.OpenReadStream();
            var    res      = OSSService.uploadFile(fromFile, filename);

            return(Rtn <UploadOutput> .Success(new UploadOutput {
                url = "http://tpjs.95t92.cn/" + filename,
                filename = filename,
                res = res
            }));
        }