c# - Run time Error while uploading images for ASP.Net MVC APP (AWS-EBS) -
my end goal save file remote content directory in aws-ec2 windows instance. destination folder "c:\inetpub\wwwroot\content" in remote server.for using
string serveradd=server.mappath("/");
i assuming above command automatically remote server root address. assumption wrong one.
post building project below code still runtime error
[httppost] public actionresult addimage(int? id, image im, httppostedfilebase imagepath) { string filename = path.getfilenamewithoutextension(imagepath.filename); string extension = path.getextension(imagepath.filename); filename = filename + datetime.now.tostring("yymmssff") +extension; string serveradd=server.mappath("/"); string remotepath = path.combine(serveradd,filename); imagepath.saveas(remotepath); }
here link using temporarily
Comments
Post a Comment