PostedFile.SaveAs doesnt work

Jul 1, 2010 at 4:02 PM
if (myFile.HasFile)
        {
            if (myFile.PostedFile.ContentLength > 8388608)
            {
                lblSonuc.Text = "bigger than 8 MB";
            }
            else
            {

                FileInfo fi = new System.IO.FileInfo(myFile.FileName);
                string filename = DateTime.Now.Ticks + myFile.FileName;
                try
                {
                    myFile.PostedFile.SaveAs(Server.MapPath("Documents/" + filename));
                }
                catch (Exception ex)
                {
                    lblSonuc.Text = ex.Message;
                }

               
                fbuserphoto.ApplicationPhoto = documentURL;

                
                try
                {
                    if (fbuserphoto.Insert() == 1)
                    {

                        lblSonuc.Text = "great";

                    }
                    else
                    {
                        lblSonuc.Text = "no!!!.";
                    }

                }
                catch (Exception ex)
                {

                    lblSonuc.Text = ex.Message;
                }

            }

Hi

 

i am very new on facebook application and i am tryin to do my first application. In this application i want the user can upload his/her photo to my server www.mydomain.com/SampleFacebookApp/

in localhost my code is working but when i try it on facebook it the file cant save on my folder and so i cannot insert it to my db.

 

although i pu try catch blocks i couldnt see the error message on facebook. and what i see is HTTP 500 error

 

is there anything different should i know when uploading pictures on a facebook application?

 

thanks