0

what is the difference between httppathrequest and server.mappath.

i mean r they return different path ?

i uploading file use httppahrequest and it works fine in my pc iis7, but when i run in server it didnt work. but server.mappath work in both

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by __avd
0

>what is the difference between httppathrequest and server.mappath.

I think you want to know about Request.MapPath and Server.MapPath.
There is no difference.

0

>what is the difference between httppathrequest and server.mappath.

I think you want to know about Request.MapPath and Server.MapPath.
There is no difference.

please check below code

savePath = Path.Combine(Request.PhysicalApplicationPath, ImageFolder);
                        saveFile = Path.Combine(savePath, FileUpload1.FileName);
                        FileUpload1.SaveAs(saveFile);

that was only in my vs08 when i run in server that not work.
but below code was worked in both

FileUpload1.SaveAs(Server.MapPath("foldername") + "\\" + FileUpload1.FileName);

for this reason one of my projec was rejected by client, so i want to explain him wha happened

0

Check this code,

Response.Write("<Br/>" + Request.PhysicalApplicationPath); // x:\test\
Response.Write("<br/>" + Server.MapPath("~"));                  //  x:\test

Edited by __avd: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.