Last post Jul 18, 2019 02:50 AM by nattikomatti
Jul 08, 2019 07:27 AM|nattikomatti|LINK
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: C:\Users\nattiko\Downloads\PicASP.net\keanu-reeves-john-wick-chapter-3-parabellum-1557912590.jpg
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement) +478495
ComputerOnlineNew.Request_Email.btn_upload_Click(Object sender, EventArgs e) in C:\Users\nattiko\source\repos\ComputerOnlineNew\ComputerOnlineNew\Request_Email.aspx.vb:376
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9782698
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +204
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639
I don't know problem. help me please.
line behide code : Dim path As String = FileUpload1. PostedFile.FileName **this error
but if run debug not error .not have problem.
Jul 08, 2019 09:25 AM|PatriceSc|LINK
It seems you are using the client side filename to read this file using Bitmap.FromFile ?
It seems to work on a development machine (this is what you mean with "debug" ?) where your machine is usually both the web server and the browser side machine but won't work on a real web server which doesn't have access to client side disk.
If confirmed you'll need to check again one of the numerous tutorials about file uploading (you upload the content of the file posted as part of the http request and you save this file somewhere on the server). You can't just use a file name to read a file
from the client side.
Jul 08, 2019 09:39 AM|Wei Zhang|LINK
According to your description ,it seems that you have used absolute path in web application.It shows this error because that when you host it on iis ,it has no rights to visit file in disk. For example ,when you host a web application on server, it is insecure
if the program can access files on the local disk.
So I suggest that you could upload the this jpg file on web application then host application on iis ,then you could use relative path in your code behind to get the resource of file.
I think it will solve your probelm
Jul 18, 2019 02:50 AM|nattikomatti|LINK