HI EVERYONE , PLEASE HELP ME , I KNOW MY WRITING IS A LITTLE LONG , PLEASE HELP ......
i use versian 6.2 the same versian as local versian that works , i store my image in binary format in ms sql database , storing image is ok . for both local and website , the problem is i can't find any good method , if you tell me how to store and retrieve images when developing a module , maybe i don't need at all to use ashx files , the reason i sue ashx file is , because i store image as binary ( that's what they want from me to be stored as binary in an ms sql server ) . in local i do that very good , and then in solution explorer of visual studio 2010 i go and add item of time web handler ( ashx ) . two type of files come , one handler.ashx and handler.ashx.cs . namespace is simply ( Resume )>>this is the name of my project . ( so i don't add any dotnetnuke.modules.Resume ) . because that is not needed i think so . then in the handler.ashx file i have this code to read data ( notice it works in local ) :
public void ProcessRequest(HttpContext context)
{
SqlConnection conn = new SqlConnection (DotNetNuke.Data.DataProvider.Instance().ConnectionString);
SqlCommand selcmd = new SqlCommand("select data from FaavanResume1_pic where pid=" + context.Request.QueryString["imgID"], conn);
conn.Open();
rdr = selcmd.ExecuteReader();
while (rdr.Read())
{
context.Response.ContentType = "image/jpg";
context.Response.BinaryWrite((byte[])rdr["data"]);
}
rdr.Close();
conn.Close();
}
and in the view.ascx i have this asp:image that sends the imgID :
( of course i change the number after = sign to get different images ( i just want to make it simple here ) . so here is how i read images .
i don't know why ? why ? it does not work in online website but works in local .
one more thing ( i am not so familier how to use an ashx , but however i managed to use it and it worked on local ) .
HERE MAYBE IS IMPORTANT : IMPORTANT : when i build my project and get my install package , i noticed that the file Ahandler.ashx is not between files , while Ahandler.ashx.cs is . so i put Ahandler.ashx manually in the source package ( of install package i get when i compile ) . and then i install it in website . but when image is uploaded . no image is shown ( the address for my image in both local and online website is =>>
http://www.favangroup.com/DesktopModu... ( this url for example was for website and exactly the same though the first is local and they differ in the beggining . but the end from \DesktopModule........ is the same . so why in online website the image is not shown and when i right click and press view image . in address bar i see a good url that i saw in my local machin . but no image and an error appears wich tells to turn on error details .