-
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:
- Cách cấp quyền cho app sau khi login bằng tài khoản facebook thông qua facebook oauth trên mvc?
- Lỗi tiêu đề khi gửi mail ���
- làm sao tạo được tabsprymenu
- Export Image từ DataTable vào file Excel
- website bị treo khi thực hiện liên tiếp cùng 1 thao tác ?
- Cách hiển thị ajax popup control ở giữa màn hình thay vì hiển thị ở target control?
- Tại sao 1Textbox render ra các tag HTML Input có ID va Name trùng nhau???
- Lỗi font khi lấy kết quả trả về từ google search
- CKDeditor trong MVC không xuất ra mã HTML là do đâu?
- Làm sao Insert từ form vào 2 table!
-
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 !
Hiện nay trên thị trường xuất hiện rất nhiều loại thuốc bôi tăng kích thước dương vật được lăng xê là có khả năng làm tăng kích cỡ dương vật của cánh mày râu. Tuy nhiên không phải loại thuốc nào cũng...
Thuốc tăng kích thước chim có tác...