Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • sreejith 10 posts 109 karma points
    Aug 10, 2014 @ 08:02
    sreejith
    0

    Description field in Gecko Uploadify

    Hi,

    Can I ask some help regarding Gecko Uploadify(1.5)!!.

    I want to upload a description field with each files in it. I have managed to add a description fieldb by modifiying the jquery.uploadify.v2.1.0.js. and the Uploadify.ascx. Now I need to store it, as an another property like image height width properties. So I would like have the source code(code behind), or an updated dll including description field. I Am using umbraco version 4.7.0.

    May I have your help in this.

  • Emanuel 63 posts 283 karma points
    Aug 10, 2014 @ 10:13
    Emanuel
    0

    Hi,

     

    Import the dll into you VisualStudio project, there should be an event in the main Gecko.Uploadify Handler class.

  • sreejith 10 posts 109 karma points
    Aug 10, 2014 @ 20:37
    sreejith
    0

    Thank you Emanuel for the response.

    Are we saying about the class UploadifyHandler But I failed to find a useful event to insert a user entered text as description in the decompiled dll.

    As I am a newbie in ASP can you please be some more elaborate. which event I have to use, and how etc. I want to create a gallery with user entered description/caption for each image. Now I have created everything (the gallery), but need to add the description field and pick that to the gallery

     Please help me. 

  • Emanuel 63 posts 283 karma points
    Aug 11, 2014 @ 11:29
    Emanuel
    100

    Hi,

    I believe the 1.5 version only has the "FileUploaded" event, which triggers before the Media item is saved in Umbraco.
    Version 1.6 does have the "FileSaved" event, which you can use like so:

    Gecko.Uploadify.UploadifyHandler.FileSaved += new Gecko.Uploadify.FileSavedEventHandler(UploadifyHandler_FileSaved);

    void UploadifyHandler_FileSaved(object sender, Gecko.Uploadify.FileSavedEventArgs e)
            {
                var mediaItem = e.Media;
                // set the description for the mediaItem object using the standard Umbraco methods
            }

  • sreejith 10 posts 109 karma points
    Aug 11, 2014 @ 12:36
    sreejith
    0

    Thank you Emanuel,

    Just need to confirm, whether i get it correct.

    if the following is my description,

      stringdescription=context.Request["description"];

    then I have to create a Global.asax

    using Gecko.Uploadify;

    namespace Your.Namespace

    {
        public class Global : umbraco.Global
        {
            protected override void Application_Start(object sender, EventArgs e)
            {
                base.Application_Start(sender, e);
                UploadifyHandler.FileUploaded += new FileUploadedEventHandler(UploadifyHandler_FileUploaded);
                UploadifyHandler.FileSaved += new FileSavedEventHandler(UploadifyHandler_FileSaved);
            }

    void UploadifyHandler_FileSaved(object sender, Gecko.Uploadify.FileSavedEventArgs e)
            {
                var mediaItem = e.Media;
                // set the description for the mediaItem object using the standard Umbraco methods

        mediaItem.getProperty("description").Value=description;

            }

    *************

     

    Am I right or can you pls correct me?. Thank you.


  • Emanuel 63 posts 283 karma points
    Aug 11, 2014 @ 12:41
    Emanuel
    0

    var description = HttpContext.Current.Request["description"];
    mediaItem.getProperty("description").Value = description;

    Seems about right to me.

  • sreejith 10 posts 109 karma points
    Aug 11, 2014 @ 12:55
    sreejith
    0

    Okay,  Global.asax is the right way to do this?

    Just Wanna make sure am in the right way. It too late for me to finish this. Thank you

  • Emanuel 63 posts 283 karma points
    Aug 11, 2014 @ 13:25
    Emanuel
    0

    Yes, that's correct.
    I have given you all the information you need, everything else is just normal Umbraco and/or ASP.NET development.

  • sreejith 10 posts 109 karma points
    Aug 11, 2014 @ 13:38
    sreejith
    0

    Thank you Emanuel. Let me try this.

Please Sign in or register to post replies

Write your reply to:

Draft