-
10-04-2011, 08:15 AM #1Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
Gửi bởi zstar
Mã:FileUpload1.SaveAs(Server.MapPath("http://HTK.com/hinhanh/" + FileUpload1.PostedFile.FileName)); Description: 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.Web.HttpException: http://HTK.com/hinhanh/tenfile is not a valid virtual path. Source File: c:\inetpub\vhosts\HTK.com\httpdocs\QT\GUI\Page.aspx.cs Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
View more random threads:
- LINQ - Cannot attach an entity that already exists
- Cách tính thứ ngày
- [Hỏi]Cách tự động định dạng thousand separator trong asp.net MVC 4
- Phân biệt CLASS - OBJECT - INSTANCE, trong đoạn code này, cái nào là intstance, object, class ?
- [Help] Chương trình thiếu file .sln
- Xuat du lieu tu datagrid ra excell trong lập trình asp.net
- Làm sao để tự động chèn 1 Video vào web ?
- Cách để QueryString mặc định như thế nào?
- Tô màu chữ trên textbox trong lập trình ASP.NET với C#
- Cách đưa source web ASP lên host để chạy ?
-
10-04-2011, 08:22 AM #2Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
ọc
cái server mappath sao lại để đường dẫn thế kia
mẫu :
Mã:FileUpload1.SaveAs(Server.MapPath("~/Upload Files/" + FileUpload1.FileName));
-
10-04-2011, 08:38 AM #3Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
Gửi bởi zstar
Mã:FileUpload1.SaveAs(Server.MapPath("~/hinhanh/" + FileUpload1.PostedFile.FileName.ToString()));
Mã:Access to the path 'C:\Inetpub\vhosts\HTK.com\httpdocs\hinhanh\phaohoa_Anh.jpg' is denied. Description: 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.UnauthorizedAccessException: Access to the path 'C:\Inetpub\vhosts\HTK.com\httpdocs\hinhanh\phaohoa_Anh.jpg' is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Click "Add" to add the appropriate user or group
Phải làm sao đây bạn
-
10-04-2011, 08:54 AM #4Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
vậy đúng như mình nói ở trên : permisson của Folder upload đang ở readonly
bạn chỉnh lại read,write là được
-
10-04-2011, 08:58 AM #5Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
Gửi bởi zstar
-
10-04-2011, 09:37 AM #6Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
Hihihi chủ hosting khóa quyền đọc - ghi file sau khi mở đã chạy dc rùi.
Thanks mọi người.
-
10-04-2011, 05:54 PM #7Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
Lỗi: Server Error in '/' Application khi upload file image trên hosting
Tôi có coding như sau thì chạy tốt trên localhost nhưng khi up lên hosting và chạy kiểm tra lại thì lại xảy ra lỗi, code như sau:
Mã:protected void btnUpload_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { lbLink.Text = "Copy chuỗi link này để chèn vào bài viết nếu cần"; /hững dòng này để chạy trên hosting // http://HTK.com là đường dẫn website trên hosting và hinhanh là folder được lưu trên hosting txtUpload.Text = "http://HTK.com/hinhanh/" + FileUpload1.PostedFile.FileName.ToString(); linkan.Text = "http://HTK.com/hinhanh/" + FileUpload1.PostedFile.FileName.ToString(); FileUpload1.SaveAs(Server.MapPath("http://HTK.com/hinhanh/" + FileUpload1.PostedFile.FileName)); /hững dòng này chạy ở localhost // txtUpload.Text = "http://localhost:56143/MyWebSite/hinhanh/" + FileUpload1.FileName; // linkan.Text = "../../FileUpload/" + FileUpload1.PostedFile.FileName; //FileUpload1.SaveAs(Server.MapPath("../../hinhanh/" + FileUpload1.PostedFile.FileName)); } else MessageBox.Show("mời chọn file ảnh"); }
Mã:Server Error in '/' Application. Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off". <!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration> Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL. <!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web> </configuration>
Chân thành cám ơn
-
10-04-2011, 05:59 PM #8Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
copy thằng này bỏ vô cofig
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
-
10-04-2011, 06:36 PM #9Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
Gửi bởi nvluong_it
Mã:<customErrors mode="On" defaultRedirect="ErrorPage.aspx"> <error statusCode="403" redirect="NoAccess.htm"/> <error statusCode="404" redirect="FileNotFound.htm"/> </customErrors>
[IMG]images/smilies/smile.png[/IMG]) ấy mà
-
10-04-2011, 07:41 PM #10Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
bạn cứ tạm thời để mode="off" xem nó lỗi ở dòng code nào
từ đó sẽ biết cách khắc phục
có thể permisson của Folder upload đang ở readonly
regard !
Vệ sinh cá nhân là một phần quan yếu của sức khỏe nam giới. Dùng dung dịch vệ sinh mỗi ngày mang lại nhiều ích, giúp loại bỏ vi khuẩn và vi sinh vật gây hại, giúp khu vực cơ quan sinh dục luôn sạch...
Gel vệ sinh cu, bạn trai có nên...