الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

مشكلة في الupluad

مغلق
بدأه الكود الصعب في 31 أغسطس 2005 · 16 رد · 1,370 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله وبركاته

في البداية أحب أشكر جميع القائمين على هذا المنتدى الرائع

كتبت كود خاص برفع الملفات الى مجلد في المشروع والحمدلله في العمل أشتغل عندي تمام لكن لما نقلت المشروع للاب توب طلعت المشكلة وهي

Access to the path "c:\inetpub\wwwroot\SFDAWebsite\images\308440.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\wwwroot\SFDAWebsite\images\308440.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 write 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.

Source Error: 


Line 127:            pos = s1.LastIndexOf("\") + 1
Line 128:            s2 = s1.Substring(pos)
Line 129:            Upload.PostedFile.SaveAs(Request.ServerVariables("APPL_PHYSICAL_PATH") & "images\" & s2)
Line 130:
Line 131:            s3 = Request.ServerVariables("APPL_PHYSICAL

أعتقد أن المشكلة ليست في البرمجة ولكن في صلاحية الدخول على الملف

أرجو مساعدتي والله يحفظكم ويرعاكم

والسلام عليكم ورحمة الله وبركاته

#2

ضع الكود التالي في ال WEB.CONFIG

<identity impersonate="true"/>

Sami is the name .net is the game

SamiKaraeen@hotmail.com

#3

السلام عليكم ورحمة الله وبركاته

فعلا الحل أخي XP.NET كما أوضحت سالفا فشكرا على مشاركتك الفاعلة أسال الله أن يجعلها في ميزان أعمالك .

والسلام عليكم ورحمة الله وبركاته

#4

السلام عليكم ..

من بعد تذنك اخي XP ممكن تشرح لي شو فائدة السطر ده الي كاتبه <identity impersonate="true"/>

#5

قمت بوضع الكود لكنه بدأ بطلب يوزر وباسوورد عن رفع الملف وحفظه

ماهي فائدة الكود وكيف اقوم بالتخلص من هالمشكله

joseph.gif

logo.gif

CCNA 640-802

مدونتي

#6

السلام عليكم

ممكن أخي "الكود الصعب" تعرفني ازاي اعمل الـupluad

شكرا

تم تعديل هذه المشاركة بواسطة الطائر التركي في 19 أبريل 2007 في 01:05

شكرا

#7

العملية تحتاج عمل Security Sharing

فقط اعط اليوزر ASPNET والويزر IUSER صلاحيات على المجلد

#8
اقتباس
فقط اعط اليوزر ASPNET والويزر IUSER صلاحيات على المجلد

مافي عندي هاليوزرات اخوي

واذكر اني من قبل كنت اسوي عملية الرفع بدون اعطاء هالتصاريح

ممكن تقولي كيف اسوي هاليوزرات واعطيها التصاريح " بالطرق الاعتياديه "

joseph.gif

logo.gif

CCNA 640-802

مدونتي

#9

موجود لانه مو راضي يضيفه

وكل مره بسوي ملف ابولد لازم اعطي تصريح للـ aspnet

joseph.gif

logo.gif

CCNA 640-802

مدونتي

#10

حطيتهم بجروب administrator

ولا استفدت شي

joseph.gif

logo.gif

CCNA 640-802

مدونتي

#11
اقتباس
Access to the path 'c:\inetpub\wwwroot\support\images' 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\wwwroot\support\images' 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.

مازالت نفس المشكله مع كل المحاولات

joseph.gif

logo.gif

CCNA 640-802

مدونتي

#12

بعد الخطوة 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.

اذهب الى ِِِAdvanced ثم اختار Replace Permissions

اسهل طريق هو ان تستخدم IIS Permission Wizard وتختار Public Site

اذا كان المجلد تم انشاءه من قبل فإنه يحتفظ بال Permissions العادية ويجب تعديل ذلك ليورث اعداداته من IIS WebSite

The World Must Be Crazy

#13

تم حل المشكله خطا بالكود حيث مسار الحفظ كان على نفس المجلد وليس بداخله شاكر لك عزيزي

joseph.gif

logo.gif

CCNA 640-802

مدونتي

#14

ومتعبنا معاك من أول <_<

لو تسمحلي بنصيحة أتمنى تستفيد منها :

ألاحظ من ردودك المتتاليه أنك تأتي بالمسكلة ومن ثم تحلها وكأنك تفكر بصوت مرتفع على حساب المنتدى

الرجاء ضع جميع الحلول والاحتمالات ومن ثم اذا لم تجد الحل أسأل ، عشان تترك لغيرك مساحة يستفيد منها وكمان تتعلم من أخطاءك

#15

مشكور عزيزي على مرورك

أعتقد ان خطأي قد يستفيد منه غيري شاكر لكم مرورك :rolleyes:

joseph.gif

logo.gif

CCNA 640-802

مدونتي

#16

اخي

اذهب الى المجلد الذي تحب ان تحفظ فيه الصورة.... اضغط باليمين عليه و اختر خصائص ثم اختر Security

هناك اضف تصريح Write لمستخدم IIS_WPG و ان شاء الله تصلح معك

Quran_Signature.jpg
#17
السـاحر كتب:
مافي عندي هاليوزرات اخوي

واذكر اني من قبل كنت اسوي عملية الرفع بدون اعطاء هالتصاريح

ممكن تقولي كيف اسوي هاليوزرات واعطيها التصاريح " بالطرق الاعتياديه "

فقط اكتب ASPNET واضغط موافق وراح ينضاف لوحده، جربت ذلك؟

logo.gif
استضافة ويندوز


اقتباس

مساحة تبدأ من 2000 ميجا بايت بسعر 1.99 دولار شهريا.ا

اقتباس

ASP.NET 1.1-2.0-3.0-3.5-4.0-4.5.1 / MVC ASP.NET / PHP 5.x / ColdFusion / MSSQL 2008 & 2012 / MYSQL

هذا الموضوع مغلق.

مواضيع مشابهة