如何从webimage转换为httppostedfilebase [英] How do I convert from webimage to httppostedfilebase

查看:232
本文介绍了如何从webimage转换为httppostedfilebase的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须将WebImage转换为HttpPostedFileBase



 MemoryStream ms = new MemoryStream(); 
uploadedFile.InputStream.CopyTo(ms);

WebImage img = DoRotate(ms,rotateBy);
if(attachment.DoUpload(Storage,Model,uploadedFile))
上传++;



我想将img传递给函数

 DoUpload(存储,型号,img)

给我错误

无法从系统,.web.helpers.webimage转换为系统.web.HttppostedFilebase 





我尝试过:



我尝试转换为base64等请让我知道应该怎么做。

解决方案

请参阅 HttpPostedFileBase Class(System.Web) [ ^ ]。

I have to Convert a WebImage to HttpPostedFileBase

MemoryStream ms = new MemoryStream();
uploadedFile.InputStream.CopyTo(ms);
                    
WebImage img = DoRotate(ms, rotateBy);
 if (attachment.DoUpload(Storage, Model, uploadedFile))
     uploaded++;


I want to pass img to the function

DoUpload(Storage, Model, img)

Gives me error

cannot convert from system,.web.helpers.webimage to system.web.HttppostedFilebase



What I have tried:

I tried Converting to base64 etc Please let me know how should I go about it.

解决方案

See HttpPostedFileBase Class (System.Web)[^].


这篇关于如何从webimage转换为httppostedfilebase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆