How to automatically capture the name of an image added to the Uploads Gallery?

Last post 07-15-2009, 8:19 PM by geoffo. 4 replies.
Sort Posts: Previous Next
  •  07-14-2009, 11:21 PM 53985

    How to automatically capture the name of an image added to the Uploads Gallery?

    I want to use the editor as part of an asp.NET input form where images are added and the editor text is the description of the item.
    Ultimately the filename of image and its description would become a database  record.
     
    Any suggestions?   
  •  07-15-2009, 2:52 AM 53990 in reply to 53985

    Re: How to automatically capture the name of an image added to the Uploads Gallery?

    HI geoffo,
     
    How to automatically capture the name of an image added to the Uploads Gallery?
     
    1. Open file 'InsertImage.aspx' (CuteSoft_Client\CuteEditor\Dialogs\InsertImage.aspx)
     
    2. Find section 'InputFile.ValidateOption.MaxSizeKB=secset.MaxImageSize;', add the section below under that section
     
      InputFile.FileUploaded+=new UploaderEventHandler(InputFile_FileUploaded);
     
    like:
     
     InputFile.ValidateOption.MaxSizeKB=secset.MaxImageSize;
     InputFile.FileUploaded += new UploaderEventHandler(InputFile_FileUploaded);
     
    3.  Add the section below into section <script runat="server"><script>
     
     protected void InputFile_FileUploaded(object sender, UploaderEventArgs args)
        {
            InputFile.InsertText = args.FileName;
        }
     
    Note: args.FileName is the unload file name you want to capture
     
    This way corresponds to the I'nsert Image' button
     
    Regards,
     
    Ken
  •  07-15-2009, 3:43 AM 53992 in reply to 53990

    Re: How to automatically capture the name of an image added to the Uploads Gallery?

    Thanks Ken.  The extra bit don't upset the functioning at all but.....
    how can I get hold of this args.FileName programmatically.
    eg:
       Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
           
              lbFileName.text = ?????
               lblDescription.Text = Editor1.Text.ToString

        End Sub 
     
    Thanks, 
  •  07-15-2009, 4:37 AM 53993 in reply to 53992

    Re: How to automatically capture the name of an image added to the Uploads Gallery?

    Hi geoffo,
     
    Can you give me a picture to show how do you use editor and when you want to capture the upload file name?
     
     
    Regards,
     
    ken
  •  07-15-2009, 8:19 PM 54019 in reply to 53993

    Re: How to automatically capture the name of an image added to the Uploads Gallery?

    I've been able to generate a public string variable 'uploadedFileName' within InsertGallery.aspx when I upload an image but want to now have it pass to the calling page (ie: Default.aspx page has the CE embedded in it).
     
    I'm sure its easy but I'm stumbling on what seems obvious. 
     
View as RSS news feed in XML