با سلام.
من سایتی ایجاد کردم که توش امکان آپلود عکس و فیلم در بخش ادمین دارم. تا امروز همه چیز درست کار می کرد و سایت رو آپلود کردم و تست کردم همه چیز درست بود و فایل ها داخل ادمین با کدهایی که نوشتم به راحتی آپلود می شد. اما الان هر کاری میکنم هیچ فایلی آپلود نمیشه. توی لوکال برنامه رو تست کردم فایل ها در سیستم خودم آپلود و ذخیره میشه اما توی هاست هیچ فایلی نمیتونم از تو برنامه آپلود کنم. به صورت دستی میتونم آپلود کنم اما از طریق برنامه نه.
هاست هم فضا داره هنوز!
در ضمن هاست و دامین plesk هست.
میشه راهنمایی کنید واقعا عجییییییبه!!!!
ارور میگه که برنامه اجازه دسترسی به این فایل رو نداره!
چه اروری میده ؟
متن ارور را قرار دهید
دسترسی Read و Write به فولدر دادید ؟
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 'D:\Inetpub\vhosts\einaki.ir\7sintour.com\Admin\image\picgallery\2016,1,18,18,43,32.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 and IIS 7, and the configured application pool identity on IIS 7.5) 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 File 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.
ببخشید هر کاری کردم عکسش رو نشد بفرستم متن ارور رو گذاشتم.
چه طور می تونم به فولدر دسترسی رید و رایت بدم؟
اگر مشکلش دسترسیشه پس چرا تا الان کار می کرد؟؟
خود متن گفته چیکار کنید
To grant ASP.NET access to a file, right-click the file in File 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.
بله ولی توی هاست با راست کلیک گزینه پروپرتیس نمیومد.از روش دیگه ای استفاده کردم و دسترسی پوشه رو تعیین کردم . درست شد.
ممنون
هیچ کاربری تا کنون از این پست تشکر نکرده است
با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)