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); } 

enter image description here

here link using temporarily


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -