Link to home
Start Free TrialLog in
Avatar of suresh pondicherry
suresh pondicherryFlag for United States of America

asked on

Add local file to HttpPostedFileBase

Hi All,
Advance thanks.
My existing page has upload button and can do upload feature using post method and  finally add the files from HttpRequest to  HttpPostedFileBase. This works fine.

My issue is
Have to do upload but not through drag and drops or selecting from the folder. Instead, i need to attach the local file into HttpPostedFileBase.

HttpPostedFileBase fileBase = load file using  File.Open(path, FileMode.Open);

I know it is not possible because it's  abstract class. My issue is i have to use HttpPostedFileBase but i need to load a local file into it.

please help.

Kind regards,
Pooja
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Hi Pooja,

When you say local file is this a file on the server or on the client side?

Regards,
Chinmay.
Avatar of suresh pondicherry

ASKER

server side
Alright. And I understand this is an ASP.Net code so what exactly you want to do with this local file by getting it inside HttpPostedFileBase . Please don't mind but I want to understand if we can come up with something better by understanding your business requirements.
ASKER CERTIFIED SOLUTION
Avatar of suresh pondicherry
suresh pondicherry
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial