2

i'm trying to develop a web mobile app using C#. its just a simple upload picture module, and get its exif. the app is working fine on normal browser on PC. file can be upload and exif can be read.

however when tested on most mobile browsers, this exception was thrown: 'Could not find a part of the path 'c:\inetpub\wwwroot\Temp\1.jpg'.

here's the line in .aspx file

<input id="imgUpload" type="file" runat="server" />

and the lines in .aspx.cs file

string filename = myProfile.ID.ToString() + ".jpg";
string physiclPath = HttpContext.Current.Server.MapPath("..\\..\\Temp\\");
imgUpload.PostedFile.SaveAs(physiclPath + filename);
Response.Write("File uploaded successfully!");

is there anything important i miss for web mobile uploads?

Uwe Keim
  • 36,867
  • 50
  • 163
  • 268
A H
  • 21
  • 1

1 Answers1

0

Check you MapPath method, whether it's mapping to correct and existing location.

Use this answer on SO as reference Server.MapPath("."), Server.MapPath("~"), Server.MapPath(@"\"), Server.MapPath("/"). What is the difference?

When you have no additional mobile web pages, then aspx web page is executed equal and not depending from mobile or desktop.

Community
  • 1
  • 1
Regfor
  • 7,973
  • 1
  • 32
  • 50