PDA

View Full Version : ارور موقع حذف فایل از روی هاست



sadaf.v
شنبه 03 تیر 1391, 18:15 عصر
سلام
من وب سایت را آپلود کردم
وقتی آپلود کردم ، تو قسمتی که فایل باید آپلود میشد ارور زیر را میداد





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>

permission اون پوشه که قرار بود آپلود بشه را full control کردم از تو قسمت کنترل پنل مشکل آپلود حل شد
ولی هنوز موقعی که میخام اون فایل را از روی سایت حذف کنم همین پیغام را میده
اون رکورد از داخل دیتا بیس حذف میشه اما فایلی که تو هر رکورد و جود داره و رو هاست کپی شده را وقتی میخام خذف کنم بازم همین ارور را میده
اگه میشه راهنماییم کنید ممنون میشم.


ای داد بیداد
هنوز که کسی جوابی نداده

mehrzad_ali
شنبه 03 تیر 1391, 21:26 عصر
کد حذفتون رو بزارید شاید ایراد از کد باشه فکر کنم مسیر رو برای حذف اشتباه میدید

sadaf.v
یک شنبه 04 تیر 1391, 09:57 صبح
نه رو لوکال درست کار میکنه
بریک پوینت گذاشتم خط به خط اجرا کردم ادرس را درست بر میگردونه







protected void GridView1_RowDeleting1(object sender, GridViewDeleteEventArgs e)
{
try
{
string sid = GridView1.DataKeys[e.RowIndex].Value.ToString();
con.Open();
cmd.Connection = con;
cmd.CommandText = string.Format("delete from picture where id={0}", sid);
cmd.ExecuteNonQuery();
cmd.Dispose();
con.Close();
string filename = Request.PhysicalApplicationPath + "picture\\" + sid + ".jpg";
if (System.IO.File.Exists(filename)) System.IO.File.Delete(filename);
}
catch (Exception ex)
{
throw new Exception(ex.ToString(), ex);
}
finally
{
Bind();
}
}

mehdi-ghafari
یک شنبه 04 تیر 1391, 14:07 عصر
گره <customeErrors> رو بذارید تو web.config و mode اون رو off کنید تا خطا رو بتون نشون بده دقیقا از کجاست. چون ممکنه اون تصویر در زمان حذف یه جای دیگه داره پردازش میشه و سرور نمیتونه اونو حذف کنه