Copied to clipboard

Flag this post as spam?

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


  • Falcon 2 posts 22 karma points
    Mar 02, 2010 @ 13:36
    Falcon
    0

    Picture gallery upload through usercontrol

    Hey!

    Im new to umbraco, and Im looking for a guide for uploading pictures to a new gallery or excisting one with an usercontrol.

    I have allready created document types like in Creative Website Starter 2.0.2, but I dont know how to upload pictures via usercontrol so that they get assigned to a gallery + gets a decription.

     

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Mar 02, 2010 @ 14:37
    Dirk De Grave
    0

    Hi Falcon,

    Best place to start is the public api for creating media items in code, here's a starting link to the online doc. Find more info on existing media types and/or creating new media types can be found here.

    if you need some more detailed info or some code snippets, let us know.

     

    Cheers,

    /Dirk

     

  • Falcon 2 posts 22 karma points
    Mar 03, 2010 @ 12:37
    Falcon
    0

            protected void btnUp_Click(object sender, EventArgs e)
            {
                //my document type is named Foto
                DocumentType foto = DocumentType.GetByAlias("Foto");
                //Making a new photo
                Document newPhoto = Document.MakeNew(txbBilledeNavn.Text, foto, User.GetUser(0), Node.GetCurrent().Id);
                //photoUp is my upload property in my Foto document type
                newPhoto.getProperty("photoUp").Value = FileUpload1.PostedFile.FileName;

             }

    This makes an error, trying to upload the photo, how come?

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies