Click here to Skip to main content
15,884,802 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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.
Posted
Updated 10-May-17 5:44am
Comments
Richard MacCutchan 10-May-17 11:41am    
You cannot cast objects in this way, you must convert them from one type to the other.
Pratik Naik 10-May-17 11:52am    
Can u give me some pointers on how to do it ?
Richard MacCutchan 10-May-17 11:58am    
No, I know nothing about these classes or what you are trying to do. Also, if you follow the link below you will see that HttpPostedFileBase is an abstract class, so you cannot create instances of it.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900