Error http error1:404:Not Found while uploading the file

Last post 07-10-2009, 8:26 AM by nazeem.khan. 7 replies.
Sort Posts: Previous Next
  •  07-07-2009, 3:25 AM 53781

    Error http error1:404:Not Found while uploading the file

    hi,
     
      I am getting the error message "http error1:404:Not Found" while uploading the file.
     
    I am able to trace the issue but it is very weird that it is reporting that the page "x.aspx" is not available.
     

    Server Error in '/ApplicationName' Application.

    The resource cannot be found.

    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

    Requested URL: /ApplicationName/(S(sdkznz55wnwak5aomd5uqvy2))/ModuleName/Compose.aspx
     
    In the above page, a user control is called in which the file upload logic is maintained.
     
    I am using the CuteWebUI.AjaxUploader.dll version 3.0.
     
    Kindly provide me the fix ASAP.
     
    Regards,
     
    Nazim
     
     
    Here is the code that is implemented in the usercontrol that is called from Compose.aspx:
     
    #region "Namespace"
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using CuteWebUI;
    #endregion

    #region "Delegate"
    public delegate void FileUploadEventHandler(object sender, FileUploadEventArgs e);
    #endregion

    public partial class UserControl_FileUpload : System.Web.UI.UserControl
    {
        #region "Delegate"
        public event FileUploadEventHandler FileUploaded;
        #endregion

        PageBase pg = null;
        PageBase.StoreObjectInSession eType = PageBase.StoreObjectInSession.LoggedUser;
        private const string KEY = "FilesUploaded";

        #region "Show or Hide Methods"
        public void Show()
        {
            LoadLocalizedStrings();
            Utility.SetPageCache();
            Attachments1.ValidateOption.AllowedFileExtensions = ConfigurationManager.AppSettings["CuteWebUI.AjaxUploader.AllowedFileExtensions"];

            if (ConfigurationManager.AppSettings["CuteWebUI.AjaxUploader.MaxFilesLimit"].Length > 0)
                Attachments1.MaxFilesLimit = Convert.ToInt32(ConfigurationManager.AppSettings["CuteWebUI.AjaxUploader.MaxFilesLimit"]);

            ShowOverlay();
        }
        #endregion

        #region "Initialization Methods"
        private void LoadLocalizedStrings()
        {
            ltFileAttachement.Text = Utility.GetPhraseFromResx(Utility.ResxFile.MC, Utility.ResxType.Others, "MC_FileAttachementCaption");
            Attachments1.InsertText = Utility.GetPhraseFromResx(Utility.ResxFile.MC, Utility.ResxType.Others, "MC_BrowseCaption");
            Attachments1.FileTooLargeMsg = Utility.GetPhraseFromResx(Utility.ResxFile.MC, Utility.ResxType.Errors, "MC_AttachmentExceedFileSizeLimit");
            Attachments1.MaxFilesLimitMsg = Utility.GetPhraseFromResx(Utility.ResxFile.MC, Utility.ResxType.Errors, "MC_AttachmentExceededTotalFileLimit");
            btnDone.Text = Utility.GetPhraseFromResx(Utility.ResxFile.MC, Utility.ResxType.Others, "MC_AttachmentDone");
            btnCancel.Text = Utility.GetPhraseFromResx(Utility.ResxFile.MC, Utility.ResxType.Others, "MC_AttachmentCancel");
        }
        #endregion

        #region "Event Handlers"
        protected void Page_Load(object sender, EventArgs e)
        {
            pg = (PageBase)this.Page;

            if (pg.SelectedUserID > 0)
                eType = PageBase.StoreObjectInSession.LoggedUser;

           if (!this.Page.ClientScript.IsStartupScriptRegistered(this.GetType(), "AlignOverlayCentered"))
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "AlignOverlayCentered", "fixOverlayWindowPosition();", true);

            //if (!this.Page.ClientScript.IsStartupScriptRegistered(this.GetType(), "HideDropDownsForIE"))
                //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "HideDropDownsForIE", "hideDropDowns();", true);

        }

        protected void btnDone_Click(object sender, EventArgs e)
        {
            CloseOverlay();
            NotifyAll();        
        }

        protected void btnCancel_Click(object sender, EventArgs e)
        {
            CloseOverlay();
        }

        private void NotifyAll()
        {
            if (FileUploaded != null)
            {

                FileUploadEventArgs args = new FileUploadEventArgs();

                args.UploadedFiles = GetHashtable();

                FileUploaded(this, args);
            }
        }

        protected void Attachments1_FileUploaded(object sender, UploaderEventArgs args)
        {
            Hashtable hFiles = null;

            hFiles = GetHashtable();

            try
            {
                hFiles.Add(args.FileGuid.ToString(), args.FileName);
            }
            catch (Exception)
            { }

            pg.AddObjectToSession(KEY, hFiles, eType);
        }

        protected void lnkClose_Click(object sender, EventArgs e)
        {
            CloseOverlay();
        }

        #endregion

        #region "Data Handler Methods"
        private Hashtable GetHashtable()
        {
            return (Hashtable) pg.GetObjectFromSession(eType, KEY);

            //ObjectToSession("FilesUploaded", hFiles, pg.SelectedUserID > 0 ? PageBase.StoreObjectInSession.SelectedUser : PageBase.StoreObjectInSession.LoggedUser);
            //if (HttpContext.Current.Session["FilesUploaded"] != null)
            //    hFiles = (Hashtable)HttpContext.Current.Session["FilesUploaded"];
            //else
            //    hFiles = new Hashtable();
            
            //return hFiles;
        }
        #endregion

        #region "Show or Hide Methods"

        private void CloseOverlay()
        {
            this.Visible = false;
            divFileUpload.Visible = false;

            if (!this.Page.ClientScript.IsStartupScriptRegistered(this.GetType(), "ShowDropDownsForIE"))
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowDropDownsForIE", "showDropDowns();", true);

        }

        private void ShowOverlay()
        {
            this.divFileUpload.Visible = true;
            this.Visible = true;

            if (!this.Page.ClientScript.IsStartupScriptRegistered(this.GetType(), "HideDropDownsForIE"))
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "HideDropDownsForIE", "hideDropDowns();", true);
        }

        public void Clear()
        {
            Attachments1.DeleteAllAttachments();
            //HttpContext.Current.Session["FilesUploaded"] = null;
            pg.RemoveObjectFromSession(eType, KEY);
        }
        #endregion

    }


    Filed under:
  •  07-07-2009, 10:34 PM 53815 in reply to 53781

    Re: Error http error1:404:Not Found while uploading the file

    Adam,
     
     Kindly respond to my post. I am having delivery this week and stuck with this issue.
     
    - Nazim
  •  07-07-2009, 11:24 PM 53817 in reply to 53781

    Re: Error http error1:404:Not Found while uploading the file

    Nazim,
     
    I think that is a cookieless issue. I am testing it.
     
    Regards,
    Terry
     
  •  07-07-2009, 11:33 PM 53818 in reply to 53815

    Re: Error http error1:404:Not Found while uploading the file

    Nazim
     
    Before we find the reason , please try this way :
     
    add this to web.config appSettings :
     
    <add key="CuteWebUI.AjaxUploader.RewritePath" value="False" />
     
    Regards,
    Terry
     
  •  07-08-2009, 12:57 AM 53822 in reply to 53781

    Re: Error http error1:404:Not Found while uploading the file

    Hi,
     
    Please download the control and try again . We have fixed it.
     
    Regards,
    Terry
     
  •  07-09-2009, 2:48 AM 53848 in reply to 53818

    Re: Error http error1:404:Not Found while uploading the file

    I added the config <add key="CuteWebUI.AjaxUploader.RewritePath" value="False" /> in appsettings.
     
    It works.
     
    I also see that you said fixed something other than this. Can you let me know what is the fix, based on that i can download the latest control?
     
    - Nazim
  •  07-09-2009, 10:12 PM 53878 in reply to 53848

    Re: Error http error1:404:Not Found while uploading the file

    Hi,
     
    We fixed the issue , and so that , you need not add the setting into web.config.
     
    If you do not want use that setting , you can download the last version.
     
    Regards,
    Terry
     
  •  07-10-2009, 8:26 AM 53886 in reply to 53878

    Re: Error http error1:404:Not Found while uploading the file

    Thanks. I am currently using the provided appsettings.
View as RSS news feed in XML